tensorflow / models

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

Eager Few Shot Object Detection Colab Example code is not working #10558

Closed kotran88 closed 2 years ago

kotran88 commented 2 years ago

I thought a year ago, it was working right. but I just run all the sample code Eager Few Shot Object Detection Colab now,

it cause error in Create model and restore weights for all but last layer

How can I deal with it?

Building model and restoring weights for fine-tuning...
---------------------------------------------------------------------------
UnimplementedError                        Traceback (most recent call last)
[<ipython-input-19-5906ad4ff27f>](https://localhost:8080/#) 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://localhost:8080/#) in _extract_features(self, preprocessed_inputs)
    223 
    224     image_features = self.classification_backbone(
--> 225         ops.pad_to_multiple(preprocessed_inputs, self._pad_to_multiple))
    226 
    227     feature_block_list = []

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

DNN library is not found. [Op:Conv2D]

Call arguments received:
  • inputs=tf.Tensor(shape=(1, 646, 646, 3), dtype=float32)
jhaigy111 commented 2 years ago

Hi, I think this has occurred on https://github.com/tensorflow/models/issues/10590 to some extent aswell.

I replaced the first line: !pip install -U --pre tensorflow=="2.2.0" with the following: !pip install tensorflow==2.8

and it worked

LanVukusic commented 2 years ago

Reset the colab environment completely and run:

!pip install tensorflow==2.8
!apt install --allow-change-held-packages libcudnn8=8.1.0.77-1+cuda11.2

as the first line (replace the provided pip install tensorflow ...)

yeqingli commented 2 years ago

Mark closed.

google-ml-butler[bot] commented 2 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you.

google-ml-butler[bot] commented 2 years ago

Closing as stale. Please reopen if you'd like to work on this further.

google-ml-butler[bot] commented 2 years ago

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