C3-W2-Eager Few Shot Object Detection error

Hi,
When running the same official notebook on GPU the following error raises:

###################################################
UnknownError: Exception encountered when calling layer “conv1_conv” (type Conv2D).

Failed to get convolution algorithm. This is probably because cuDNN failed to initialize, so try looking to see if a warning log message was printed above. [Op:Conv2D]

Call arguments received:
• inputs=tf.Tensor(shape=(1, 646, 646, 3), dtype=float32)
##################################################

however, running it on TPU does not cause any issues!
What could be the problem?

Hello,

Which assignment or lab is this?

It is class 3, week 2, lab titled “Eager few shot object detection”

I have come across the issue, it was caused by the line of code that installs version 2.0 of tensorflow which seems to be incompatable with the already installed cuda version on CoLab… Hence, the solution was by discarding the installation of TF version 2.0, and using the default one in CoLab environment.

2 Likes

Great, I think this tutorial is not managed by our team and I heard before that they have done some updates on Tensorflow which required our assignments to be updated slightly and it seems other Colab tutorials might need to be updated too.

1 Like

Hello,
@ TF-AT mentors:
I have perhaps similar problem due to not updated dependencies on the official “interactive_eager_few_shot_od_training_colab.ipynb” : installations went well but once it is trying to import tensor flow I get:

/usr/local/lib/python3.7/dist-packages/tensorflow/python/client/pywrap_tf_session.py in () 17 # pylint: disable=invalid-import-order,g-bad-import-order, wildcard-import, unused-import 18 from tensorflow.python import pywrap_tensorflow —> 19 from tensorflow.python.client._pywrap_tf_session import * 20 from tensorflow.python.client._pywrap_tf_session import _TF_SetTarget 21 from tensorflow.python.client._pywrap_tf_session import _TF_SetConfig

ImportError: SystemError: <built-in method contains of dict object at 0x7f7105924e10> returned a result with an error set

It is a bit frustrating that it happens on a course notebook … as I do not know now how to proceed: shall I try a workaround of you (which one? remove TF>=…? or it will be fixed once for all soon? Thanks

Hey there,

I tried the colab notebook and what worked for me is not installing the suggested tensorflow, instead install

!pip install tensorflow===2.3.0

then restart the runtime and run from next line. It worked for me the error didnt show up.

As I said before I am not sure if our team manages this colab but I am going to raise an issue, so if they do they can fix it.

I have the same problem, and unfortunately none of the mentioned solutions in this post have been successful.

I also tried later with the same approach I used before, but didn’t work… Seems like there is a lot of dependencies that must be setup first even when working in Google Colab​:pensive:.

Hi @chris.favila, maybe you have a suggestion for the guys here how to work around these update issues. Thanks Chris.

Hi all! Thank you for reporting! I think the pip install at the beginning and Colab’s default TF version (TF2.7 as of this writing) is breaking some of the dependencies to use the Object Detection API and Colab’s GPU. Here are the steps to get around it:

  1. Choose Runtime > Factory Reset runtime and Runtime > Change Runtime type > GPU (in case you’ve run this lab earlier).
  2. Delete the first 3 code cells:

  1. Replace what you’ve deleted with the code cells from the Installation section of the Week 2 assignment Those should be the four code cells shown below (ignoring the markdown).

With that, you can now run all cells. As Gent mentioned, this notebook is hosted by Tensorflow so we can’t modify it ourselves. Hope this workaround will suffice!

3 Likes

This totally worked for me

1 Like

Thanks a lot @gent.spah and @chris.favila, eventually it worked.

1 Like