ZSD_Release
ZSD_Release copied to clipboard
python detect.py causng error
When I do: python detect.py Dataset/Sampleinput/input.png,
I get the following error:
Traceback (most recent call last):
File "detect.py", line 123, in
Could you resolve this issue? I checked the shape is (None ,). That might be causing the problem. My question is why shape is (None ,)?
When I do: python detect.py Dataset/Sampleinput/input.png,
I get the following error:
Traceback (most recent call last): File "detect.py", line 123, in shared_layers = nn.nn_base(img_input, trainable=True) File "/data2/charades2/ZSD_Release/keras_frcnn/resnet.py", line 182, in nn_base x = FixedBatchNormalization(axis=bn_axis, name='bn_conv1')(x) File "/home/user/anaconda3/lib/python3.7/site-packages/keras/backend/tensorflow_backend.py", line 75, in symbolic_fn_wrapper return func(*args, **kwargs) File "/home/user/anaconda3/lib/python3.7/site-packages/keras/engine/base_layer.py", line 463, in call self.build(unpack_singleton(input_shapes)) File "/data2/charades2/ZSD_Release/keras_frcnn/FixedBatchNormalization.py", line 31, in build trainable=False) File "/home/user/anaconda3/lib/python3.7/site-packages/keras/engine/base_layer.py", line 279, in add_weight weight = K.variable(initializer(shape, dtype=dtype), File "/home/user/anaconda3/lib/python3.7/site-packages/keras/initializers.py", line 46, in call return K.constant(1, shape=shape, dtype=dtype) File "/home/user/anaconda3/lib/python3.7/site-packages/keras/backend/tensorflow_backend.py", line 649, in constant value, dtype=dtype, shape=shape, name=name) File "/home/user/anaconda3/lib/python3.7/site-packages/tensorflow_core/python/keras/backend.py", line 937, in constant return constant_op.constant(value, dtype=dtype, shape=shape, name=name) File "/home/user/anaconda3/lib/python3.7/site-packages/tensorflow_core/python/framework/constant_op.py", line 258, in constant allow_broadcast=True) File "/home/user/anaconda3/lib/python3.7/site-packages/tensorflow_core/python/framework/constant_op.py", line 287, in _constant_impl return _eager_fill(shape.as_list(), t, ctx) File "/home/user/anaconda3/lib/python3.7/site-packages/tensorflow_core/python/framework/constant_op.py", line 52, in _eager_fill dims = convert_to_eager_tensor(dims, ctx, dtypes.int32) File "/home/user/anaconda3/lib/python3.7/site-packages/tensorflow_core/python/framework/constant_op.py", line 96, in convert_to_eager_tensor return ops.EagerTensor(value, ctx.device_name, dtype) ValueError: Attempt to convert a value (None) with an unsupported type (<class 'NoneType'>) to a Tensor.
Could you resolve this issue? I checked the shape is (None ,). That might be causing the problem. My question is why shape is (None ,)?
Hi, I have the same problem. Did you find the solution?
When the tensorflow and keras version are higher than the requirements provided by author. Please make sure the code in resnet.py: Change if K.image_dim_ordering() == 'tf' towards if K.image_data_format() == 'channels_last' And if K.image_dim_ordering() == 'th' towards if K.image_data_format() == 'channels_first'