Error while using utils

I am trying to run the code in google colab notebook but getting an error in the following code snippet-
“”"
from utils import resize_image
resized_image = resize_image(raw_image, input_size=1024)
resized_image
“”"

The error is-
ImportError: cannot import name ‘resize_image’ from ‘utils’ (/usr/local/lib/python3.10/dist-packages/utils/init.py)

Please suggest solution for the same. Thanks

1 Like

You haven’t downloaded all the necessary files to run the codes in Google colab.

While importing utils, the unit py file is also required. Check if you are following all the necessary steps, to do it in your own Google colab

Thank you for your response. I am unable to find the utils.py file either in that particular lecture or in the appendix, please let me know from where to get it.

1 Like

Typically, you can find the utils.py file by using the “File->Open” menu.

Then click on the checkbox next to the file name, and a “Download” button will be available.

image

3 Likes

Thanks for replying her as I was busy.

Thank you @TMosh for your reply, I got the file following the above as you suggested.

1 Like