PointPillars icon indicating copy to clipboard operation
PointPillars copied to clipboard

Get ERROR msg "'unicode' object is not callable" when I implement my test script.

Open inSight-mk1 opened this issue 5 years ago • 4 comments

Hello, I'm new to tensorflow keras api and 3d object detection.
When I call tf.keras.models.load_model() func after training the model, got the following error msg which make me confusion:

Traceback (most recent call last):
  File "/home/xxx/tensorflow/PointPillars-master/test.py", line 24, in <module>
    pillar_net_trained = tf.keras.models.load_model(os.path.join(log_dir, "finished.h5"))
  File "/home/xxx/.local/lib/python2.7/site-packages/tensorflow/python/keras/engine/saving.py", line 235, in load_model
    model = model_from_config(model_config, custom_objects=custom_objects)
  File "/home/xxx/.local/lib/python2.7/site-packages/tensorflow/python/keras/engine/saving.py", line 325, in model_from_config
    return deserialize(config, custom_objects=custom_objects)
  File "/home/xxx/.local/lib/python2.7/site-packages/tensorflow/python/keras/layers/serialization.py", line 74, in deserialize
    printable_module_name='layer')
  File "/home/xxx/.local/lib/python2.7/site-packages/tensorflow/python/keras/utils/generic_utils.py", line 192, in deserialize_keras_object
    list(custom_objects.items())))
  File "/home/xxx/.local/lib/python2.7/site-packages/tensorflow/python/keras/engine/network.py", line 1273, in from_config
    process_node(layer, node_data)
  File "/home/xxx/.local/lib/python2.7/site-packages/tensorflow/python/keras/engine/network.py", line 1231, in process_node
    layer(input_tensors[0], **kwargs)
  File "/home/xxx/.local/lib/python2.7/site-packages/tensorflow/python/keras/engine/base_layer.py", line 554, in __call__
    outputs = self.call(inputs, *args, **kwargs)
  File "/home/xxx/.local/lib/python2.7/site-packages/tensorflow/python/keras/layers/core.py", line 743, in call
    return self.function(inputs, **arguments)
  File "/home/xxx/tensorflow/PointPillars-master/network.py", line 33, in <lambda>
    if batch_size > 1:
TypeError: 'unicode' object is not callable

In File "/home/xxx/tensorflow/PointPillars-master/network.py", there are these codes around line 33:

    if batch_size > 1:
        corrected_indices = tf.keras.layers.Lambda(lambda t: correct_batch_indices(t, batch_size))(input_indices)
    else:
        corrected_indices = input_indices

inSight-mk1 avatar Apr 23 '19 06:04 inSight-mk1

Same problem.

corrected_indices = tf.keras.layers.Lambda(lambda t: correct_batch_indices(t, batch_size))(int(input_indices)) TypeError: 'str' object is not callable

sivaprasadraju avatar Jun 19 '19 09:06 sivaprasadraju

@in4ight @sivaprasadraju could you share your test script ? thanks a lot, my mail is [email protected]

lonlonago avatar Nov 22 '19 02:11 lonlonago

Same problem. @in4ight @sivaprasadraju Has your problem been solved? And if so, could you share the solution? Thanks very much.

xiaocongcsu avatar Feb 07 '20 07:02 xiaocongcsu

@sivaprasadraju Bro did you solved the problem,and i have downloaded the log file (from drive)how to see the output after feeding the testing folder please help,what is the code?????

Manueljohnson063 avatar Feb 18 '21 06:02 Manueljohnson063