Intel® Distribution of OpenVINO™ Toolkit
Community assistance about the Intel® Distribution of OpenVINO™ toolkit, OpenCV, and all aspects of computer vision-related on Intel® platforms.
6433 Discussions

How to make input fixed in a tensorflow zoo model?


I took a Resnet Inception V2 model from TensorFlow Zoo which should be supported and I retrained it on my custom dataset. After retraining, I took the weights from inference folder and tried to use the mvncCompile on them and got the error:


Traceback (most recent call last):


File "/usr/local/bin/mvNCCompile", line 118, in


create_graph(, args.inputnode, args.outputnode, args.outfile, args.nshaves, args.inputsize, args.weights)


File "/usr/local/bin/mvNCCompile", line 104, in create_graph


net = parse_tensor(args, myriad_config)


File "/usr/local/bin/ncsdk/Controllers/", line 259, in parse_tensor


input_data = np.random.uniform(0, 1, shape)


File "mtrand.pyx", line 1309, in mtrand.RandomState.uniform


File "mtrand.pyx", line 242, in mtrand.cont2_array_sc


TypeError: 'NoneType' object cannot be interpreted as an integer


The command I used: mvNCCompile -s 12 frozen_inference_graph.pb -in=image_tensor -on=raw_detection_scores


Now I realize this is because movidius doesn't support variable sized inputs but can anyone please tell me where do I change the code to make the input fixed size?


This is the model code:


I'm just a beginner so any help will be appreciated.



0 Kudos
1 Reply

Hi @ali18997


Since you're using Tensorflow, you'll have to change your code to declare a specific size for the input placeholder instead of using a variable size (variable sized inputs are set as "none"). Here is an example of a fixed input size:


input_image = tf.placeholder("float", [1, image_size, image_size, 3], name="input"). (if this was set to accept variable input sizes, type "None" would be passed).


I hope this is helpful!


Best Regards,


0 Kudos