frame

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Sign In

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Yolov3

I try to convert yolov3-tiny to caffe. The prototxt like https://github.com/Amalle/Yolov3_caffe/blob/master/models/caffe/yolov3-tiny.prototxt
And I convert the graph using the following:

$ mvNCCompile models/caffe/yolov3-tiny.prototxt -w models/caffe/yolov3-tiny.caffemodel -s 12 -ec
mvNCCompile v02.00, Copyright @ Intel Corporation 2017
/usr/local/bin/ncsdk/Controllers/FileIO.py:65: UserWarning: You are using a large type. Consider reducing your data sizes for best performance
Blob generated

But the predicted result size was wrong.
Then I try mvNCProfile:
$ mvNCProfile models/caffe/yolov3-tiny.prototxt -w models/caffe/yolov3-tiny.caffemodel -ec
mvNCProfile v02.00, Copyright @ Intel Corporation 2017
/usr/local/bin/ncsdk/Controllers/FileIO.py:65: UserWarning: You are using a large type. Consider reducing your data sizes for best performance
Blob generated
USB: Transferring Data...
/usr/local/lib/python3.5/dist-packages/mvnc/mvncapi.py:420: DeprecationWarning: The binary mode of fromstring is deprecated, as it behaves surprisingly on unicode inputs. Use frombuffer instead
Time to Execute :  266.8  ms
USB: Myriad Execution Finished
Time to Execute :  248.16  ms
USB: Myriad Execution Finished
Traceback (most recent call last):
  File "/usr/local/bin/mvNCProfile", line 156, in <module>
    profile_net(args.network, args.inputnode, args.outputnode, args.nshaves, args.inputsize, args.weights, args.device_no, args.explicit_concat, args.ma2480, args.scheduler, args)
  File "/usr/local/bin/mvNCProfile", line 142, in profile_net
    timings, myriad_output = run_myriad(graph_file, args)
  File "/usr/local/bin/ncsdk/Controllers/MiscIO.py", line 248, in run_myriad
    myriad_output = myriad_output.reshape(sz[1], sz[2], sz[3])
ValueError: cannot reshape array of size 41308 into shape (1,1,215475)

@Tome_at_Intel

Comments

  • 2 Comments sorted by Votes Date Added
  • @maqiao Looks like this Tiny Yolo v3 uses a concat as the last layer. There is a known issue where the NCSDK has issues with models having concat as the last layer. Some users have found work arounds by using dummy reshape layers https://ncsforum.movidius.com/discussion/comment/2831/#Comment_2831. Try this and let me know if this works for you.

  • edited July 16 Vote Up0Vote Down

    @Tome_at_Intel Thanks
    I have try that. It can't works for me.
    The last three layers as following:

    layer {
      name: "conv13_perm"
      type: "Permute"
      bottom: "conv13"
      top: "conv13_perm"
      permute_param {
        order: 0
        order: 2
        order: 3
        order: 1
      }
    }
    layer {
      name: "conv13_flat"
      type: "Flatten"
      bottom: "conv13_perm"
      top: "conv13_flat"
      flatten_param {
        axis: 1
      }
    }
    layer {
      name: "output"
      type: "Concat"
      bottom: "conv13_flat"
      bottom: "conv10_flat"
      top: "output"
      concat_param {
        axis: 1
      }
    }

    Try this:
    `
    $ mvNCProfile models/caffe/yolov3-tiny.prototxt -w models/caffe/yolov3-tiny.caffemodel -s 12 -on conv13_perm -ec
    mvNCProfile v02.00, Copyright @ Intel Corporation 2017

    /usr/local/bin/ncsdk/Controllers/FileIO.py:65: UserWarning: You are using a large type. Consider reducing your data sizes for best performance
    Blob generated
    USB: Transferring Data...
    Time to Execute : 216.87 ms
    USB: Myriad Execution Finished
    Time to Execute : 197.8 ms
    USB: Myriad Execution Finished
    USB: Myriad Connection Closing.
    USB: Myriad Connection Closed.
    Network Summary

    Detailed Per Layer Profile
    Bandwidth time

    Name MFLOPs (MB/s) (ms)

    0 data 0.0176147.1 0.006
    1 scale1 149.5 1175.5 7.582
    2 pool1 2.8 792.4 6.666
    3 scale2 398.7 859.5 13.839
    4 pool2 1.4 926.3 2.851
    5 scale3 398.7 648.0 9.226
    6 pool3 0.7 957.8 1.379
    7 scale4 398.7 403.3 7.717
    8 pool4 0.3 947.6 0.697
    9 scale5 398.7 203.8 10.051
    10 pool5 0.2 924.2 0.357
    11 scale6 398.7 323.6 9.250
    12 pool6 0.4 411.4 0.401
    13 crop6 0.0 2180.1 0.088
    14 scale7 1594.9 314.8 33.309
    15 scale8 88.6 331.9 2.501
    16 scale9 398.7 323.5 9.252
    17 conv10 44.1 311.0 1.332
    18 scale11 11.1 441.6 0.328
    19 scale11_s0 0.0 33.8 0.010
    20 upsample_p0 0.0 156.4 0.264
    21 scale11_s1 0.0 38.7 0.009
    ......
    273 scale11_s127 0.0 38.2 0.009
    274 upsample_p127 0.0 158.2 0.261
    275 pool_deconv 0.1 566.3 0.292
    276 route 0.0 1950.4 0.085
    277 route_scale5 0.0 2094.7 0.158
    278 scale12 1196.2 210.3 29.215
    279 conv13 88.3 197.3 2.305
    280 conv10_perm 0.0 310.1 0.265
    281 conv10_flat 0.0 179.6 0.458

    282 conv13_perm 0.0 182.7 1.800

    Total inference time 186.13

    Generating Profile Report 'output_report.html'...
    `

    But, the following was wrong:
    `
    $ mvNCProfile models/caffe/yolov3-tiny.prototxt -w models/caffe/yolov3-tiny.caffemodel -s 12 -on conv13_flat -ec
    mvNCProfile v02.00, Copyright @ Intel Corporation 2017

    /usr/local/bin/ncsdk/Controllers/FileIO.py:65: UserWarning: You are using a large type. Consider reducing your data sizes for best performance
    Blob generated
    USB: Transferring Data...
    Segmentation fault (core dumped)
    `

Sign In or Register to comment.