models icon indicating copy to clipboard operation
models copied to clipboard

TypeError: predict() missing 1 required positional argument: 'true_image_shapes'

Open Mona9955 opened this issue 8 years ago • 2 comments

When I tried to export the pb file from the trained model:ckpt files , I met this problem the code i typed in are

python object_detection/export_inference_graph.py
--input_type image_tensor
--pipeline_config_path object_detection/pbfile/faster_rcnn_resnet101_voc07.config
--trained_checkpoint_prefix object_detection/ckpt/tiny-yolo-voc-125
--output_directory output_inference_graph.pb

and the errors are

/home/cmm/anaconda3/lib/python3.6/site-packages/h5py/init.py:36: FutureWarning: Conversion of the second argument of issubdtype from float to np.floating is deprecated. In future, it will be treated as np.float64 == np.dtype(float).type. from ._conv import register_converters as _register_converters Traceback (most recent call last): File "object_detection/export_inference_graph.py", line 147, in tf.app.run() File "/home/cmm/anaconda3/lib/python3.6/site-packages/tensorflow/python/platform/app.py", line 126, in run _sys.exit(main(argv)) File "object_detection/export_inference_graph.py", line 143, in main FLAGS.output_directory, input_shape) File "/home/cmm/models-master/research/object_detection/exporter.py", line 397, in export_inference_graph input_shape, optimize_graph, output_collection_name) File "/home/cmm/models-master/research/object_detection/exporter.py", line 328, in _export_inference_graph output_tensors = detection_model.predict(preprocessed_inputs) TypeError: predict() missing 1 required positional argument: 'true_image_shapes' I really don't know the reason and I really want to figure it out , looking forward to your help.

Mona9955 avatar Apr 02 '18 13:04 Mona9955

From https://github.com/tensorflow/models/blob/master/research/object_detection/exporter.py#L324, it seems that the code has a different interface than your stack trace. Can you check your local Git repository and make sure the code is up to date?

Thanks.

qlzh727 avatar Apr 03 '18 17:04 qlzh727

Closing this issue as working as intended. Feel free to reopen it if you still hit any issue.

qlzh727 avatar Apr 09 '18 00:04 qlzh727