TypeError: 'int' object is not subscriptable
I have just run the colab and install the requirements. How can I resolve this?
TypeError Traceback (most recent call last)
[<ipython-input-16-75c695310352>](https://localhost:8080/#) in <module>
20
21 # Restore checkpoint.
---> 22 model = model_lib.Model(config)
23 checkpoint = tf.train.Checkpoint(
24 model=model, global_step=tf.Variable(0, dtype=tf.int64))
[/content/pix2seq/models/ar_model.py](https://localhost:8080/#) in __init__(self, config, **kwargs)
50 else:
51 self.encoder = ResNetTransformer(
---> 52 config.image_size[0], config.image_size[1], config.resnet_variant,
53 config.resnet_depth, config.resnet_width_multiplier,
54 config.resnet_sk_ratio, config.num_encoder_layers, config.dim_att,
TypeError: 'int' object is not subscriptable
Hi, I have also faced this error. Please, help us. Thanks.
Looks like the image size should be a tuple instead of int, eg (320, 320) instead of 320. can you try to modify that and see if that works?
That solves the issue.
But I do not see any bbox on the result. The image and result are the same and there is no bbox or label on the image.
Updating the image_size seems to work for me. This is what I tried:
del config.model.image_size
del config.task.image_size
del config.tasks[0]["image_size"]
config.model.image_size = (640, 640)
config.task.image_size = (640, 640)
config.tasks[0]["image_size"] = (640, 640)
Still doesnt work for me tried to make the image_size a tuple: config.model.image_size = (640, 640)
With above changes I get this error:
TypeError Traceback (most recent call last)
10 frames /usr/local/lib/python3.9/dist-packages/keras/utils/generic_utils.py in validate_kwargs(kwargs, allowed_kwargs, error_message) 513 for kwarg in kwargs: 514 if kwarg not in allowed_kwargs: --> 515 raise TypeError(error_message, kwarg) 516 517
TypeError: ('Keyword argument not understood:', 'synchronized')
@shamitb could you please paste the full stacktrace?
same error