tensorflow / models

Models and examples built with TensorFlow
Other
77.02k stars 45.78k forks source link

Eager Few Shot Object Detection Colab notebook not wokring #10792

Closed rickwierenga closed 2 years ago

rickwierenga commented 2 years ago

Prerequisites

Please answer the following questions for yourself before submitting an issue.

1. The entire URL of the file you are using

https://github.com/tensorflow/models/blob/master/research/object_detection/colab_tutorials/eager_few_shot_od_training_tf2_colab.ipynb

2. Describe the bug

Colab tutorial does not work. Cell starting with tf.keras.backend.clear_session() gives the following error.

Building model and restoring weights for fine-tuning...
---------------------------------------------------------------------------
UnimplementedError                        Traceback (most recent call last)
[<ipython-input-17-5906ad4ff27f>](https://lhmbecrxdw-496ff2e9c6d22116-0-colab.googleusercontent.com/outputframe.html?vrz=colab-20220922-060051-RC00_476055999#) in <module>
     37 # Run model through a dummy image so that variables are created
     38 image, shapes = detection_model.preprocess(tf.zeros([1, 640, 640, 3]))
---> 39 prediction_dict = detection_model.predict(image, shapes)
     40 _ = detection_model.postprocess(prediction_dict, shapes)
     41 print('Weights restored!')

3 frames
[/usr/local/lib/python3.7/dist-packages/object_detection/models/ssd_resnet_v1_fpn_keras_feature_extractor.py](https://lhmbecrxdw-496ff2e9c6d22116-0-colab.googleusercontent.com/outputframe.html?vrz=colab-20220922-060051-RC00_476055999#) in _extract_features(self, preprocessed_inputs)
    222 
    223     image_features = self.classification_backbone(
--> 224         ops.pad_to_multiple(preprocessed_inputs, self._pad_to_multiple))
    225 
    226     feature_block_list = []

UnimplementedError: Exception encountered when calling layer "conv1_conv" "                 f"(type Conv2D).

{{function_node __wrapped__Conv2D_device_/job:localhost/replica:0/task:0/device:GPU:0}} DNN library is not found. [Op:Conv2D]

Call arguments received by layer "conv1_conv" "                 f"(type Conv2D):
  • inputs=tf.Tensor(shape=(1, 646, 646, 3), dtype=float32)

3. Steps to reproduce

1 download notebook 2 upload notebook to colab 3 hit run

4. Expected behavior

run without error

5. Additional context

-

6. System information

default colab, latest (?)

rickwierenga commented 2 years ago

This fixes it.

!apt install --allow-change-held-packages libcudnn8=8.1.0.77-1+cuda11.2
google-ml-butler[bot] commented 2 years ago

Are you satisfied with the resolution of your issue? Yes No

sineeli commented 2 years ago

As the problem is resolved closing the issue.

Thank you.