Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

RetinaNet model tries to write to system directory #833

Open
rhysperry111 opened this issue Feb 12, 2024 · 0 comments
Open

RetinaNet model tries to write to system directory #833

rhysperry111 opened this issue Feb 12, 2024 · 0 comments

Comments

@rhysperry111
Copy link

When trying to use ObjectDetection on an image with RetinaNet I get the following error:

Traceback (most recent call last):
  File "/home/rhys/src/imagerec/detector.py", line 19, in <module>
    detection = detector.detectObjectsFromImage(input_image=image)
                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/site-packages/imageai/Detection/__init__.py", line 387, in detectObjectsFromImage
    fnames, original_imgs, scaled_images = self.__load_image_retinanet(input_image)
                                           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/site-packages/imageai/Detection/__init__.py", line 150, in __load_image_retinanet
    input_image = self.__save_temp_img(input_image=input_image)
                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/site-packages/imageai/Detection/__init__.py", line 131, in __save_temp_img
    input_image.save(temp_path)
  File "/usr/lib/python3.11/site-packages/PIL/Image.py", line 2436, in save
    fp = builtins.open(filename, "w+b")
         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
PermissionError: [Errno 13] Permission denied: '/usr/lib/python3.11/site-packages/imageai/Detection/e28e5dc8-a4cd-4238-bd9b-95a60ab9c46f.jpg'

It seems to be trying to write to the system directory with which imageai is installed. I can fix the error by running as root, however this is obviously not the correct way to solve the problem, and it also ends up cluttering the system directory.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant