Closed pboudoin closed 5 years ago
I have the same issue.
ValueError: Cannot use 'roi_align_1/map/while/strided_slice_20' as input to 'roi_align_1/map/while/zeros/packed' because 'roi_align_1/map/while/strided_slice_20' is in a while loop. See info log for more details.
You need tensorflow 1.12 and keras 2.24.
Hi all,
sorry for the late reply, but I just started the Master in CS @ Polytechnic of Milan and I had to focus my attention to that for a while.
I suggest to try out my google colab that I personally use to not have to heat up my computer :)
https://colab.research.google.com/drive/11ytb0srMyOGXQtHoF0ocCkKGNTb7fvmq
I had a private conversation with @pboudoin and it worked, at least on the colab setup.
Let me know if this is still an issue, I'll close it for the moment.
I've tried to make it work on my laptop but I face many issues.
I'm running Python 3.6.8 (through conda) on Mac OS X 10.14.6 I've done :
$pip install maskrcnn-modanet
download the 3Go dataset
$maskrcnn-modanet instagram -p reginaanikiy -c s
And I've got a lot of warning, deprecated API use and finally an error: `$ …/Downloads/maskrcnn maskrcnn-modanet instagram -p reginaanikiy -c s Stored ID 612257866 for profile reginaanikiy. <Profile reginaanikiy (612257866)> Retrieving posts from profile reginaanikiy. [ 1/499] [ 2/499] ... [498/499] [499/499] Using TensorFlow backend. /anaconda3/envs/virtualfittingroom/lib/python3.6/site-packages/tensorflow/python/framework/dtypes.py:516: FutureWarning: Passing (type, 1) or '1type' as a synonym of type is deprecated; in a future version of numpy, it will be understood as (type, (1,)) / '(1,)type'. _np_qint8 = np.dtype([("qint8", np.int8, 1)]) /anaconda3/envs/virtualfittingroom/lib/python3.6/site-packages/tensorflow/python/framework/dtypes.py:517: FutureWarning: Passing (type, 1) or '1type' as a synonym of type is deprecated; in a future version of numpy, it will be understood as (type, (1,)) / '(1,)type'. _np_quint8 = np.dtype([("quint8", np.uint8, 1)]) /anaconda3/envs/virtualfittingroom/lib/python3.6/site-packages/tensorflow/python/framework/dtypes.py:518: FutureWarning: Passing (type, 1) or '1type' as a synonym of type is deprecated; in a future version of numpy, it will be understood as (type, (1,)) / '(1,)type'. _np_qint16 = np.dtype([("qint16", np.int16, 1)]) /anaconda3/envs/virtualfittingroom/lib/python3.6/site-packages/tensorflow/python/framework/dtypes.py:519: FutureWarning: Passing (type, 1) or '1type' as a synonym of type is deprecated; in a future version of numpy, it will be understood as (type, (1,)) / '(1,)type'. _np_quint16 = np.dtype([("quint16", np.uint16, 1)]) /anaconda3/envs/virtualfittingroom/lib/python3.6/site-packages/tensorflow/python/framework/dtypes.py:520: FutureWarning: Passing (type, 1) or '1type' as a synonym of type is deprecated; in a future version of numpy, it will be understood as (type, (1,)) / '(1,)type'. _np_qint32 = np.dtype([("qint32", np.int32, 1)]) /anaconda3/envs/virtualfittingroom/lib/python3.6/site-packages/tensorflow/python/framework/dtypes.py:525: FutureWarning: Passing (type, 1) or '1type' as a synonym of type is deprecated; in a future version of numpy, it will be understood as (type, (1,)) / '(1,)type'. np_resource = np.dtype([("resource", np.ubyte, 1)]) /anaconda3/envs/virtualfittingroom/lib/python3.6/site-packages/tensorboard/compat/tensorflow_stub/dtypes.py:541: FutureWarning: Passing (type, 1) or '1type' as a synonym of type is deprecated; in a future version of numpy, it will be understood as (type, (1,)) / '(1,)type'. _np_qint8 = np.dtype([("qint8", np.int8, 1)]) /anaconda3/envs/virtualfittingroom/lib/python3.6/site-packages/tensorboard/compat/tensorflow_stub/dtypes.py:542: FutureWarning: Passing (type, 1) or '1type' as a synonym of type is deprecated; in a future version of numpy, it will be understood as (type, (1,)) / '(1,)type'. _np_quint8 = np.dtype([("quint8", np.uint8, 1)]) /anaconda3/envs/virtualfittingroom/lib/python3.6/site-packages/tensorboard/compat/tensorflow_stub/dtypes.py:543: FutureWarning: Passing (type, 1) or '1type' as a synonym of type is deprecated; in a future version of numpy, it will be understood as (type, (1,)) / '(1,)type'. _np_qint16 = np.dtype([("qint16", np.int16, 1)]) /anaconda3/envs/virtualfittingroom/lib/python3.6/site-packages/tensorboard/compat/tensorflow_stub/dtypes.py:544: FutureWarning: Passing (type, 1) or '1type' as a synonym of type is deprecated; in a future version of numpy, it will be understood as (type, (1,)) / '(1,)type'. _np_quint16 = np.dtype([("quint16", np.uint16, 1)]) /anaconda3/envs/virtualfittingroom/lib/python3.6/site-packages/tensorboard/compat/tensorflow_stub/dtypes.py:545: FutureWarning: Passing (type, 1) or '1type' as a synonym of type is deprecated; in a future version of numpy, it will be understood as (type, (1,)) / '(1,)type'. _np_qint32 = np.dtype([("qint32", np.int32, 1)]) /anaconda3/envs/virtualfittingroom/lib/python3.6/site-packages/tensorboard/compat/tensorflow_stub/dtypes.py:550: FutureWarning: Passing (type, 1) or '1type' as a synonym of type is deprecated; in a future version of numpy, it will be understood as (type, (1,)) / '(1,)type'. np_resource = np.dtype([("resource", np.ubyte, 1)]) WARNING:tensorflow:From /anaconda3/envs/virtualfittingroom/lib/python3.6/site-packages/maskrcnn_modanet/processimages.py:65: The name tf.ConfigProto is deprecated. Please use tf.compat.v1.ConfigProto instead.
WARNING:tensorflow:From /anaconda3/envs/virtualfittingroom/lib/python3.6/site-packages/maskrcnn_modanet/processimages.py:67: The name tf.Session is deprecated. Please use tf.compat.v1.Session instead.
2019-09-23 16:48:51.814559: I tensorflow/core/platform/cpu_feature_guard.cc:142] Your CPU supports instructions that this TensorFlow binary was not compiled to use: AVX2 FMA /Users/p.boudoin/Downloads/maskrcnn/results/resnet50_coco_v0.2.0.h5 tracking <tf.Variable 'Variable:0' shape=(9, 4) dtype=float32> anchors tracking <tf.Variable 'Variable_1:0' shape=(9, 4) dtype=float32> anchors tracking <tf.Variable 'Variable_2:0' shape=(9, 4) dtype=float32> anchors tracking <tf.Variable 'Variable_3:0' shape=(9, 4) dtype=float32> anchors tracking <tf.Variable 'Variable_4:0' shape=(9, 4) dtype=float32> anchors WARNING:tensorflow:From /anaconda3/envs/virtualfittingroom/lib/python3.6/site-packages/keras_retinanet/backend/tensorflow_backend.py:68: The name tf.image.resize_images is deprecated. Please use tf.image.resize instead.
WARNING:tensorflow:From /anaconda3/envs/virtualfittingroom/lib/python3.6/site-packages/keras/backend/tensorflow_backend.py:4070: The name tf.nn.max_pool is deprecated. Please use tf.nn.max_pool2d instead.
WARNING:tensorflow:From /anaconda3/envs/virtualfittingroom/lib/python3.6/site-packages/keras_retinanet/backend/tensorflow_backend.py:104: add_dispatch_support..wrapper (from tensorflow.python.ops.array_ops) is deprecated and will be removed in a future version.
Instructions for updating:
Use tf.where in 2.0, which has the same broadcast rule as np.where
Traceback (most recent call last):
File "/anaconda3/envs/virtualfittingroom/lib/python3.6/site-packages/tensorflow/python/ops/array_ops.py", line 1871, in zeros
output = _constant_if_small(zero, shape, dtype, name)
File "/anaconda3/envs/virtualfittingroom/lib/python3.6/site-packages/tensorflow/python/ops/array_ops.py", line 1828, in _constant_if_small
if np.prod(shape) < 1000:
File "/anaconda3/envs/virtualfittingroom/lib/python3.6/site-packages/tensorflow/python/ops/gen_math_ops.py", line 5169, in less
"Less", x=x, y=y, name=name)
File "/anaconda3/envs/virtualfittingroom/lib/python3.6/site-packages/tensorflow/python/framework/op_def_library.py", line 788, in _apply_op_helper
op_def=op_def)
File "/anaconda3/envs/virtualfittingroom/lib/python3.6/site-packages/tensorflow/python/util/deprecation.py", line 507, in new_func
return func(*args, **kwargs)
File "/anaconda3/envs/virtualfittingroom/lib/python3.6/site-packages/tensorflow/python/framework/ops.py", line 3616, in create_op
op_def=op_def)
File "/anaconda3/envs/virtualfittingroom/lib/python3.6/site-packages/tensorflow/python/framework/ops.py", line 2043, in init
self._control_flow_post_processing()
File "/anaconda3/envs/virtualfittingroom/lib/python3.6/site-packages/tensorflow/python/framework/ops.py", line 2052, in _control_flow_post_processing
control_flow_util.CheckInputFromValidContext(self, input_tensor.op)
File "/anaconda3/envs/virtualfittingroom/lib/python3.6/site-packages/tensorflow/python/ops/control_flow_util.py", line 350, in CheckInputFromValidContext
raise ValueError(error_msg + " See info log for more details.")
ValueError: Cannot use 'roi_align_1/map/while/strided_slice_20' as input to 'roi_align_1/map/while/zeros/Less' because 'roi_align_1/map/while/strided_slice_20' is in a while loop. See info log for more details.
During handling of the above exception, another exception occurred:
Traceback (most recent call last): File "/anaconda3/envs/virtualfittingroom/bin/maskrcnn-modanet", line 10, in
sys.exit(main())
File "/anaconda3/envs/virtualfittingroom/lib/python3.6/site-packages/click/core.py", line 764, in call
return self.main(args, kwargs)
File "/anaconda3/envs/virtualfittingroom/lib/python3.6/site-packages/click/core.py", line 717, in main
rv = self.invoke(ctx)
File "/anaconda3/envs/virtualfittingroom/lib/python3.6/site-packages/click/core.py", line 1137, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File "/anaconda3/envs/virtualfittingroom/lib/python3.6/site-packages/click/core.py", line 956, in invoke
return ctx.invoke(self.callback, ctx.params)
File "/anaconda3/envs/virtualfittingroom/lib/python3.6/site-packages/click/core.py", line 555, in invoke
return callback(args, kwargs)
File "/anaconda3/envs/virtualfittingroom/lib/python3.6/site-packages/click/decorators.py", line 17, in new_func
return f(get_current_context(), *args, *kwargs)
File "/anaconda3/envs/virtualfittingroom/lib/python3.6/site-packages/maskrcnn_modanet/cli/main.py", line 122, in instagram
instagramImpl(profile, limit=limit, offset=offset, choice=choice, restore_result=restore_result)
File "/anaconda3/envs/virtualfittingroom/lib/python3.6/site-packages/maskrcnn_modanet/instagram_impl.py", line 428, in instagramImpl
model, labels_to_names = loadModel(model_type='coco')
File "/anaconda3/envs/virtualfittingroom/lib/python3.6/site-packages/maskrcnn_modanet/processimages.py", line 58, in loadModel
model = models.load_model(model_path, backbone_name='resnet50')
File "/anaconda3/envs/virtualfittingroom/lib/python3.6/site-packages/keras_maskrcnn/models/init.py", line 59, in load_model
return keras.models.load_model(filepath, custom_objects=backbone(backbone_name).custom_objects)
File "/anaconda3/envs/virtualfittingroom/lib/python3.6/site-packages/keras/engine/saving.py", line 492, in load_wrapper
return load_function(args, kwargs)
File "/anaconda3/envs/virtualfittingroom/lib/python3.6/site-packages/keras/engine/saving.py", line 584, in load_model
model = _deserialize_model(h5dict, custom_objects, compile)
File "/anaconda3/envs/virtualfittingroom/lib/python3.6/site-packages/keras/engine/saving.py", line 274, in _deserialize_model
model = model_from_config(model_config, custom_objects=custom_objects)
File "/anaconda3/envs/virtualfittingroom/lib/python3.6/site-packages/keras/engine/saving.py", line 627, in model_from_config
return deserialize(config, custom_objects=custom_objects)
File "/anaconda3/envs/virtualfittingroom/lib/python3.6/site-packages/keras/layers/init.py", line 168, in deserialize
printable_module_name='layer')
File "/anaconda3/envs/virtualfittingroom/lib/python3.6/site-packages/keras/utils/generic_utils.py", line 147, in deserialize_keras_object
list(custom_objects.items())))
File "/anaconda3/envs/virtualfittingroom/lib/python3.6/site-packages/keras/engine/network.py", line 1075, in from_config
process_node(layer, node_data)
File "/anaconda3/envs/virtualfittingroom/lib/python3.6/site-packages/keras/engine/network.py", line 1025, in process_node
layer(unpack_singleton(input_tensors), kwargs)
File "/anaconda3/envs/virtualfittingroom/lib/python3.6/site-packages/keras/engine/base_layer.py", line 489, in call
output = self.call(inputs, kwargs)
File "/anaconda3/envs/virtualfittingroom/lib/python3.6/site-packages/keras_maskrcnn/layers/roi.py", line 89, in call
parallel_iterations=self.parallel_iterations
File "/anaconda3/envs/virtualfittingroom/lib/python3.6/site-packages/keras_retinanet/backend/tensorflow_backend.py", line 35, in map_fn
return tensorflow.map_fn(*args, *kwargs)
File "/anaconda3/envs/virtualfittingroom/lib/python3.6/site-packages/tensorflow/python/ops/map_fn.py", line 268, in map_fn
maximum_iterations=n)
File "/anaconda3/envs/virtualfittingroom/lib/python3.6/site-packages/tensorflow/python/ops/control_flow_ops.py", line 3501, in while_loop
return_same_structure)
File "/anaconda3/envs/virtualfittingroom/lib/python3.6/site-packages/tensorflow/python/ops/control_flow_ops.py", line 3012, in BuildLoop
pred, body, original_loop_vars, loop_vars, shape_invariants)
File "/anaconda3/envs/virtualfittingroom/lib/python3.6/site-packages/tensorflow/python/ops/control_flow_ops.py", line 2937, in _BuildLoop
body_result = body(packed_vars_for_body)
File "/anaconda3/envs/virtualfittingroom/lib/python3.6/site-packages/tensorflow/python/ops/control_flow_ops.py", line 3456, in
body = lambda i, lv: (i + 1, orig_body(lv))
File "/anaconda3/envs/virtualfittingroom/lib/python3.6/site-packages/tensorflow/python/ops/map_fn.py", line 257, in compute
packed_fn_values = fn(packed_values)
File "/anaconda3/envs/virtualfittingroom/lib/python3.6/site-packages/keras_maskrcnn/layers/roi.py", line 72, in _roi_align
keras.backend.zeros((keras.backend.shape(level_boxes)[0],), dtype='int32'),
File "/anaconda3/envs/virtualfittingroom/lib/python3.6/site-packages/keras/backend/tensorflow_backend.py", line 963, in zeros
v = tf.zeros(shape=shape, dtype=dtype, name=name)
File "/anaconda3/envs/virtualfittingroom/lib/python3.6/site-packages/tensorflow/python/ops/array_ops.py", line 1880, in zeros
shape = ops.convert_to_tensor(shape, dtype=dtypes.int32)
File "/anaconda3/envs/virtualfittingroom/lib/python3.6/site-packages/tensorflow/python/framework/ops.py", line 1087, in convert_to_tensor
return convert_to_tensor_v2(value, dtype, preferred_dtype, name)
File "/anaconda3/envs/virtualfittingroom/lib/python3.6/site-packages/tensorflow/python/framework/ops.py", line 1145, in convert_to_tensor_v2
as_ref=False)
File "/anaconda3/envs/virtualfittingroom/lib/python3.6/site-packages/tensorflow/python/framework/ops.py", line 1224, in internal_convert_to_tensor
ret = conversion_func(value, dtype=dtype, name=name, as_ref=as_ref)
File "/anaconda3/envs/virtualfittingroom/lib/python3.6/site-packages/tensorflow/python/ops/array_ops.py", line 1145, in _autopacking_conversion_function
return _autopacking_helper(v, dtype, name or "packed")
File "/anaconda3/envs/virtualfittingroom/lib/python3.6/site-packages/tensorflow/python/ops/array_ops.py", line 1095, in _autopacking_helper
return gen_array_ops.pack(elems_as_tensors, name=scope)
File "/anaconda3/envs/virtualfittingroom/lib/python3.6/site-packages/tensorflow/python/ops/gen_array_ops.py", line 5897, in pack
"Pack", values=values, axis=axis, name=name)
File "/anaconda3/envs/virtualfittingroom/lib/python3.6/site-packages/tensorflow/python/framework/op_def_library.py", line 788, in _apply_op_helper
op_def=op_def)
File "/anaconda3/envs/virtualfittingroom/lib/python3.6/site-packages/tensorflow/python/util/deprecation.py", line 507, in new_func
return func(args, **kwargs)
File "/anaconda3/envs/virtualfittingroom/lib/python3.6/site-packages/tensorflow/python/framework/ops.py", line 3616, in create_op
op_def=op_def)
File "/anaconda3/envs/virtualfittingroom/lib/python3.6/site-packages/tensorflow/python/framework/ops.py", line 2043, in init
self._control_flow_post_processing()
File "/anaconda3/envs/virtualfittingroom/lib/python3.6/site-packages/tensorflow/python/framework/ops.py", line 2052, in _control_flow_post_processing
control_flow_util.CheckInputFromValidContext(self, input_tensor.op)
File "/anaconda3/envs/virtualfittingroom/lib/python3.6/site-packages/tensorflow/python/ops/control_flow_util.py", line 350, in CheckInputFromValidContext
raise ValueError(error_msg + " See info log for more details.")
ValueError: Cannot use 'roi_align_1/map/while/strided_slice_20' as input to 'roi_align_1/map/while/zeros/packed' because 'roi_align_1/map/while/strided_slice_20' is in a while loop. See info log for more details.`
Could you help me and provide your python, TensorFlow, Keras versions please?