Shubhamai / plant-disease-detection

The Website predicts if the leaf🌿 is healthy or not using by taking plant's left image using Machine Learning🤖
GNU General Public License v3.0
23 stars 8 forks source link

OSError: Unable to open file (unable to open file: name = 'model_weights.h5', errno = 2, error message = 'No such file or directory', flags = 0, o_flags = 0) #16

Closed johnfelipe closed 2 years ago

johnfelipe commented 3 years ago
apt install python3-pip
pip install streamlit
git clone https://github.com/Shubhamai/plant-disease-detection.git
cd plant-disease-detection
pip install -r requirements.txt
streamlit run app.py

show this

OSError: Unable to open file (unable to open file: name = 'model_weights.h5', errno = 2, error message = 'No such file or directory', flags = 0, o_flags = 0)
Traceback:
File "/usr/local/lib/python3.8/dist-packages/streamlit/ScriptRunner.py", line 322, in _run_script
    exec(code, module.__dict__)
File "/root/plant-disease-detection/app.py", line 55, in <module>
    model = load_model('model_weights.h5')
File "/usr/local/lib/python3.8/dist-packages/streamlit/caching.py", line 594, in wrapped_func
    return get_or_create_cached_value()
File "/usr/local/lib/python3.8/dist-packages/streamlit/caching.py", line 578, in get_or_create_cached_value
    return_value = func(*args, **kwargs)
File "/root/plant-disease-detection/app.py", line 40, in load_model
    model.load_weights(path)
File "/usr/local/lib/python3.8/dist-packages/tensorflow/python/keras/engine/training.py", line 2227, in load_weights
    with h5py.File(filepath, 'r') as f:
File "/usr/local/lib/python3.8/dist-packages/h5py/_hl/files.py", line 406, in __init__
    fid = make_fid(name, mode, userblock_size,
File "/usr/local/lib/python3.8/dist-packages/h5py/_hl/files.py", line 173, in make_fid
    fid = h5f.open(name, flags, fapl=fapl)
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 88, in h5py.h5f.open

can u share files missing tnks

Shubhamai commented 2 years ago

Sorry for a very very...... very late replay, but I have updated the instructions in the readme, you can find the model file in my kaggle notebook . Just download the model from the link and save it as model_weights.h5 in the main directory of the repo.