fizyr / keras-retinanet

Keras implementation of RetinaNet object detection.
Apache License 2.0
4.38k stars 1.96k forks source link

"List index of out of range error " during inference ( Show up this week ) #1537

Closed syln21 closed 3 years ago

syln21 commented 3 years ago

Hello, i have been using same notebook on colab for more than 2 months with same weights and dependencies. It started to give me error this week. I didn't change anything. It suprisingly started to give me error. while loading the model. Could you please help me ?

IndexError Traceback (most recent call last)

in () 3 4 # load retinanet model ----> 5 model = models.load_model(model_path, backbone_name='resnet50') 6 model = models.convert_model(model) 7 8 frames /usr/local/lib/python3.7/dist-packages/tensorflow/python/keras/engine/functional.py in process_node(layer, node_data) 1222 add_unprocessed_node(layer, node_data) 1223 return -> 1224 inbound_node = inbound_layer._inbound_nodes[inbound_node_index] 1225 input_tensors.append( 1226 nest.flatten(inbound_node.outputs)[inbound_tensor_index]) IndexError: list index out of range
AndreiIonut1 commented 3 years ago

I believe this is happening because colab upgraded to tensorflow 2.5

syln21 commented 3 years ago

I believe this is happening because colab upgraded to tensorflow 2.5

Thanks for your reply, I tried to downgrade tensorflow with pip install tensorflow==2.3.0 but still have the same problem, Do you have any suggestion

AndreiIonut1 commented 3 years ago

The way I managed to get it to work is to install miniconda in google colab and then install tensorflow-gpu 2.4.0.

ra024940 commented 3 years ago

I'm also facing this issue.

syln21 commented 3 years ago

The way I managed to get it to work is to install miniconda in google colab and then install tensorflow-gpu 2.4.0.

It was related to my final project of bachelor degree, thanks to you i completed it. Thank you very much. I appreciate it

syln21 commented 3 years ago

I'm also facing this issue.

You should do exactly how @AndreiIonut1 explained. It works ,Good luck

AlexandrAstafiev commented 3 years ago

Can I have a piece of code or a link to a working colab?

ra024940 commented 3 years ago

Can I have a piece of code or a link to a working colab?

yes, of course. i really appreciate you taking the time to check it.

https://colab.research.google.com/drive/1frDF_8a3CB-EKCe1bRdjzeMaDa8MzlK0?usp=sharing

AlexandrAstafiev commented 3 years ago

I am asking for an example of a solution to the problem. I have the same problem.

mateoochoa commented 3 years ago

You should check issue #1535, All these problems have the same reason, google colab change the version of its libraries and in some of these broke the support for the RetinaNet.

kirthan0899 commented 3 years ago

Issue resolved. Check here

stale[bot] commented 3 years ago

This issue has been automatically marked as stale due to the lack of recent activity. It will be closed if no further activity occurs. Thank you for your contributions.