You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
YoloV3_V4_tiny_training.ipynb - convert_weights_pb.py error: Cannot convert a symbolic Tensor (detector/yolo-v4-tiny/meshgrid/Size_1:0) to a numpy array.
#22
Open
itsderek23 opened this issue
Mar 24, 2022
· 3 comments
!python3 convert_weights_pb.py \
--yolo $yolo_version \
--weights_file $weights_best \
--class_names /content/obj.names \
--output $output_name_pb \
--tiny \
-h 320 \
-w 512
WARNING:tensorflow:
The TensorFlow contrib module will not be included in TensorFlow 2.0.
For more information, please see:
* https://github.com/tensorflow/community/blob/master/rfcs/20180907-contrib-sunset.md
* https://github.com/tensorflow/addons
* https://github.com/tensorflow/io (for I/O related ops)
If you depend on functionality not listed there, please file an issue.
WARNING:tensorflow:From convert_weights_pb.py:94: The name tf.app.run is deprecated. Please use tf.compat.v1.app.run instead.
None
WARNING:tensorflow:From convert_weights_pb.py:68: The name tf.placeholder is deprecated. Please use tf.compat.v1.placeholder instead.
W0323 14:01:30.138594 140253906458496 module_wrapper.py:139] From convert_weights_pb.py:68: The name tf.placeholder is deprecated. Please use tf.compat.v1.placeholder instead.
WARNING:tensorflow:From convert_weights_pb.py:76: The name tf.variable_scope is deprecated. Please use tf.compat.v1.variable_scope instead.
W0323 14:01:30.147910 140253906458496 module_wrapper.py:139] From convert_weights_pb.py:76: The name tf.variable_scope is deprecated. Please use tf.compat.v1.variable_scope instead.
WARNING:tensorflow:From /tensorflow-1.15.2/python3.7/tensorflow_core/contrib/layers/python/layers/layers.py:1057: Layer.apply (from tensorflow.python.keras.engine.base_layer) is deprecated and will be removed in a future version.
Instructions for updating:
Please use `layer.__call__` method instead.
W0323 14:01:30.156273 140253906458496 deprecation.py:323] From /tensorflow-1.15.2/python3.7/tensorflow_core/contrib/layers/python/layers/layers.py:1057: Layer.apply (from tensorflow.python.keras.engine.base_layer) is deprecated and will be removed in a future version.
Instructions for updating:
Please use `layer.__call__` method instead.
Traceback (most recent call last):
File "convert_weights_pb.py", line 94, in <module>
tf.app.run()
File "/tensorflow-1.15.2/python3.7/tensorflow_core/python/platform/app.py", line 40, in run
_run(main=main, argv=argv, flags_parser=_parse_flags_tolerate_undef)
File "/usr/local/lib/python3.7/dist-packages/absl/app.py", line 312, in run
_run_main(main, args)
File "/usr/local/lib/python3.7/dist-packages/absl/app.py", line 258, in _run_main
sys.exit(main(argv))
File "convert_weights_pb.py", line 77, in main
detections = model(inputs, len(classes), anchors, data_format=FLAGS.data_format)
File "/content/yolo2openvino/models/yolo_v4_tiny.py", line 87, in yolo_v4_tiny
net, num_classes, anchors[3:6], img_size, data_format)
File "/content/yolo2openvino/models/common.py", line 79, in _detection_layer
a, b = tf.meshgrid(grid_x, grid_y)
File "/tensorflow-1.15.2/python3.7/tensorflow_core/python/ops/array_ops.py", line 2943, in meshgrid
mult_fact = ones(shapes, output_dtype)
File "/tensorflow-1.15.2/python3.7/tensorflow_core/python/ops/array_ops.py", line 2560, in ones
output = _constant_if_small(one, shape, dtype, name)
File "/tensorflow-1.15.2/python3.7/tensorflow_core/python/ops/array_ops.py", line 2295, in _constant_if_small
if np.prod(shape) < 1000:
File "<__array_function__ internals>", line 6, in prod
File "/usr/local/lib/python3.7/dist-packages/numpy/core/fromnumeric.py", line 3052, in prod
keepdims=keepdims, initial=initial, where=where)
File "/usr/local/lib/python3.7/dist-packages/numpy/core/fromnumeric.py", line 86, in _wrapreduction
return ufunc.reduce(obj, axis, dtype, out, **passkwargs)
File "/tensorflow-1.15.2/python3.7/tensorflow_core/python/framework/ops.py", line 736, in __array__
" array.".format(self.name))
NotImplementedError: Cannot convert a symbolic Tensor (detector/yolo-v4-tiny/meshgrid/Size_1:0) to a numpy array.
I'm running on Google Colab. Here is a gist of the notebook output.
The text was updated successfully, but these errors were encountered:
Thanks. Looks like downgrading numpy causes a conflict w/pandas:
import pandas as pd
import numpy as np
# colnames are wrong so we have to fix them
colnames=['xmin', 'ymin', 'xmax', 'ymax', 'frame', 'label', 'preview']
df = pd.read_csv(f"{ds_path}/labels.csv")
df.rename(columns = {"xmax":"ymin", "ymin":"xmax"}, inplace = True)
filter_categories = ["Car"]
df = df[df['Label'].str.contains("|".join(filter_categories))]
df.head()
25 if _nlv < Version(_min_numpy_ver):
26 raise ImportError(
---> 27 f"this version of pandas is incompatible with numpy < {_min_numpy_ver}\n"
28 f"your numpy version is {_np_version}.\n"
29 f"Please upgrade numpy to >= {_min_numpy_ver} to use this pandas version"
ImportError: this version of pandas is incompatible with numpy < 1.17.3
your numpy version is 1.16.6.
Please upgrade numpy to >= 1.17.3 to use this pandas version
The following cell:
Fails w/the output below:
I'm running on Google Colab. Here is a gist of the notebook output.
The text was updated successfully, but these errors were encountered: