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

Getting error while using >> my_model.use_release() #244

Closed
PravinM83 opened this issue Aug 12, 2021 · 2 comments
Closed

Getting error while using >> my_model.use_release() #244

PravinM83 opened this issue Aug 12, 2021 · 2 comments

Comments

@PravinM83
Copy link

Describe the bug
Getting error while using >> my_model.use_release() on windows 10 - 64 Bit

To Reproduce
Steps to reproduce the behavior:
from deepforest import deepforest
img_path = "/Users/NITIN/Documents/DeepForest Testing/crop3.png"
img = cv2.imread(img_path)
my_model = deepforest.deepforest()
my_model.use_release()

Environment (please complete the following information):

  • OS: Windows 10
  • Python version and environment : Python 3.8 , Anaconda3 on Laptop

Screenshots
If applicable, add screenshots to help explain your problem.
image

Additional context
Add any other context about the problem here.

ERROR DETAILS :

Reading config file: C:\Users\NITIN\anaconda3\envs\testforest\lib\site-packages\deepforest\data\deepforest_config.yml
A blank deepforest object created. To perform prediction, either train or load an existing model.
Model from DeepForest release https://github.com/weecology/DeepForest/releases/tag/1.0.0 was already downloaded. Loading model from file.
Loading pre-built model: https://github.com/weecology/DeepForest/releases/tag/1.0.0

OSError Traceback (most recent call last)
in
1 my_model = deepforest.deepforest()
----> 2 my_model.use_release()

~\anaconda3\envs\testforest\lib\site-packages\deepforest\deepforest.py in use_release(self, gpus)
169 # Suppress compilte warning, not relevant here
170 warnings.filterwarnings("ignore", category=UserWarning)
--> 171 self.model = utilities.read_model(self.weights, self.config)
172
173 # Convert model

~\anaconda3\envs\testforest\lib\site-packages\deepforest\utilities.py in read_model(model_path, config)
47 with warnings.catch_warnings():
48 # warnings.simplefilter('ignore', UserWarning)
---> 49 model = models.load_model(model_path, backbone_name='resnet50')
50
51 return model

~\anaconda3\envs\testforest\lib\site-packages\deepforest\keras_retinanet\models_init_.py in load_model(filepath, backbone_name)
81 """
82 import keras.models
---> 83 return keras.models.load_model(filepath, custom_objects=backbone(backbone_name).custom_objects)
84
85

~\anaconda3\envs\testforest\lib\site-packages\keras\engine\saving.py in load_wrapper(*args, **kwargs)
490 os.remove(tmp_filepath)
491 return res
--> 492 return load_function(*args, **kwargs)
493
494 return load_wrapper

~\anaconda3\envs\testforest\lib\site-packages\keras\engine\saving.py in load_model(filepath, custom_objects, compile)
581
582 if H5Dict.is_supported_type(filepath):
--> 583 with H5Dict(filepath, mode='r') as h5dict:
584 model = _deserialize_model(h5dict, custom_objects, compile)
585 elif hasattr(filepath, 'write') and callable(filepath.write):

~\anaconda3\envs\testforest\lib\site-packages\keras\utils\io_utils.py in init(self, path, mode)
189 self._is_file = False
190 elif isinstance(path, six.string_types) or _is_path_instance(path):
--> 191 self.data = h5py.File(path, mode=mode)
192 self._is_file = True
193 elif isinstance(path, dict):

~\anaconda3\envs\testforest\lib\site-packages\h5py_hl\files.py in init(self, name, mode, driver, libver, userblock_size, swmr, rdcc_nslots, rdcc_nbytes, rdcc_w0, track_order, **kwds)
406 fid = make_fid(name, mode, userblock_size,
407 fapl, fcpl=make_fcpl(track_order=track_order),
--> 408 swmr=swmr)
409
410 if isinstance(libver, tuple):

~\anaconda3\envs\testforest\lib\site-packages\h5py_hl\files.py in make_fid(name, mode, userblock_size, fapl, fcpl, swmr)
171 if swmr and swmr_support:
172 flags |= h5f.ACC_SWMR_READ
--> 173 fid = h5f.open(name, flags, fapl=fapl)
174 elif mode == 'r+':
175 fid = h5f.open(name, h5f.ACC_RDWR, fapl=fapl)

h5py_objects.pyx in h5py._objects.with_phil.wrapper()

h5py_objects.pyx in h5py._objects.with_phil.wrapper()

h5py\h5f.pyx in h5py.h5f.open()

OSError: Unable to open file (file signature not found)

@ethanwhite
Copy link
Member

Hi @PravinM83 - it looks like you are using an old version of deepforest. We have recently switched from tensorflow to pytorch due to issues with external dependencies (see #195). Can you follow the new Installation (https://deepforest.readthedocs.io/en/latest/installation.html) and Getting Started (https://deepforest.readthedocs.io/en/latest/getting_started.html) guides and see if that takes care of things.

@ethanwhite
Copy link
Member

@PravinM83 - I'm going to go ahead and close this for now. Feel free to reopen if you're still having issues.

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

3 participants