micmon icon indicating copy to clipboard operation
micmon copied to clipboard

Error 21

Open Pascalx77 opened this issue 3 years ago • 1 comments

First of all, great code, I like it. I am newbe a python with my raspberry pi. I read your article ,"towardsdatascience.com/create-your-own-smart-baby-monitor-with-a-raspberrypi". I have this error with the train.py and I don't understand what is the problem, any hint will be appreciated:

Traceback (most recent call last): File "train.py", line 54, in model.save(model_dir, overwrite=True) File "/usr/local/lib/python3.7/dist-packages/micmon-0.1-py3.7.egg/micmon/model/init.py", line 58, in save File "/usr/local/lib/python3.7/dist-packages/tensorflow_core/python/keras/engine/network.py", line 986, in save signatures, options) File "/usr/local/lib/python3.7/dist-packages/tensorflow_core/python/keras/saving/save.py", line 112, in save_model model, filepath, overwrite, include_optimizer) File "/usr/local/lib/python3.7/dist-packages/tensorflow_core/python/keras/saving/hdf5_format.py", line 92, in save_model_to_hdf5 f = h5py.File(filepath, mode='w') File "/usr/local/lib/python3.7/dist-packages/h5py/_hl/files.py", line 445, in init swmr=swmr) File "/usr/local/lib/python3.7/dist-packages/h5py/_hl/files.py", line 201, in make_fid fid = h5f.create(name, h5f.ACC_TRUNC, fapl=fapl, fcpl=fcpl) File "h5py/_objects.pyx", line 54, in h5py._objects.with_phil.wrapper File "h5py/_objects.pyx", line 55, in h5py._objects.with_phil.wrapper File "h5py/h5f.pyx", line 116, in h5py.h5f.create IsADirectoryError: [Errno 21] Unable to create file (unable to open file: name = '/home/pi/models/sound-detect', errno = 21, error message = 'Is a directory', flags = 13, o_flags = 242)

Pascalx77 avatar Mar 14 '21 04:03 Pascalx77

I was having the same problem. In my case it was caused by the version of Tensorflow installed by pip on Raspberry by default being too old (1.14.0 in my case). Changing to the newest version fixed this (see e.g. this guide https://towardsdatascience.com/3-ways-to-install-tensorflow-2-on-raspberry-pi-fe1fa2da9104). Looks like there were a lot of changes in Tensorflow 2.0, including how output is written. See also https://github.com/BlackLight/micmon/issues/1#issuecomment-770771096.

jenssss avatar Mar 20 '21 07:03 jenssss