0

I am getting this error while training Nan efficient net model.

Downloading data from https://storage.googleapis.com/keras-applications/efficientnetb0.h5
Traceback (most recent call last):
  File "efficient_net.py", line 45, in <module>
    base_model = EfficientNetB0(include_top=True, weights='imagenet', input_shape=input_shape)
  File "/home/ubuntu/projects/XXXX/vevn37/lib/python3.7/site-packages/tensorflow/python/keras/applications/efficientnet.py", line 540, in EfficientNetB0
    **kwargs)
  File "/home/ubuntu/projects/XXXX/vevn37/lib/python3.7/site-packages/tensorflow/python/keras/applications/efficientnet.py", line 406, in EfficientNet
    file_hash=file_hash)
  File "/home/ubuntu/projects/XXXX/vevn37/lib/python3.7/site-packages/tensorflow/python/keras/utils/data_utils.py", line 275, in get_file
    urlretrieve(origin, fpath, dl_progress)
  File "/usr/lib/python3.7/urllib/request.py", line 257, in urlretrieve
    tfp = open(filename, 'wb')
PermissionError: [Errno 13] Permission denied: '/home/ubuntu/.keras/models/efficientnetb0.h5'

I have tried to change the permission of my python code:

chmod 777 code.py

It did not work.

Celik
  • 2,311
  • 2
  • 32
  • 54
  • Does the process writing your program have write permissions on that file location? – Roddy of the Frozen Peas Jun 05 '23 at 11:37
  • @RoddyoftheFrozenPeas I have changed the permission of the code.py to 777 as I edited on the question. It did not work. Is there any other way of giving permission t the process?? let me know. thank you – Celik Jun 05 '23 at 11:55
  • The question is whether the _process_ has permissions on the '/home/ubuntu/.keras/models/efficientnetb0.h5' file. The permissions on the code.py file aren't really relevant. Whatever user is running your code (eg you in the commandline, an exec/fork from another process, a container, etc.) needs to have write permissions on that .h5 file. (Do you really need _write_ permissions? you could try not requesting 'wb' if that's the case.) – Roddy of the Frozen Peas Jun 05 '23 at 12:42
  • As you haven't shared a single line of code, it's close to impossible to provide help. What did you try to resolve the problem? Where are you stuck? – Nico Haase Aug 25 '23 at 08:34

0 Answers0