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

Import failed #193

Open
dberma15 opened this issue Mar 15, 2018 · 2 comments
Open

Import failed #193

dberma15 opened this issue Mar 15, 2018 · 2 comments

Comments

@dberma15
Copy link

Hi,

I'm having trouble implementing the model. The problem is I'm running it on a VM without an internet connection, so everything either has to be presaved to a file or loaded from code.
If I try to run the code specifying a backbone:

backbone=keras_rcnn.I models.backbone.VGG16
model = keras_rcnn.models.RCNN((img_size,img_size,3),['cell'],backbone=backbone)

I have problems loading VGG16.

If I save run that code on my computer, save it to "untrained_RCNN_VGG16.h5", and try to load that with

from keras_rcnn.models import RCNN
from keras_rcnn.layers import Anchor
model=load_model("untrained_RCNN_VGG16.h5",{'RCNN':keras_rcnn.models.RCNN,'Anchor':Anchor})

I get the error


> Traceback (most recent call last):
>   File "<stdin>", line 1, in <module>
>   File "/home/bermads1/anaconda3/lib/python3.6/site-packages/keras/models.py", line 240, in load_model
>     model = model_from_config(model_config, custom_objects=custom_objects)
>   File "/home/bermads1/anaconda3/lib/python3.6/site-packages/keras/models.py", line 314, in model_from_config
>     return layer_module.deserialize(config, custom_objects=custom_objects)
>   File "/home/bermads1/anaconda3/lib/python3.6/site-packages/keras/layers/__init__.py", line 55, in deserialize
>     printable_module_name='layer')
>   File "/home/bermads1/anaconda3/lib/python3.6/site-packages/keras/utils/generic_utils.py", line 140, in deserialize_keras_object
>     list(custom_objects.items())))
>   File "/home/bermads1/anaconda3/lib/python3.6/site-packages/keras/engine/topology.py", line 2490, in from_config
>     process_layer(layer_data)
>   File "/home/bermads1/anaconda3/lib/python3.6/site-packages/keras/engine/topology.py", line 2476, in process_layer
>     custom_objects=custom_objects)
>   File "/home/bermads1/anaconda3/lib/python3.6/site-packages/keras/layers/__init__.py", line 55, in deserialize
>     printable_module_name='layer')
>   File "/home/bermads1/anaconda3/lib/python3.6/site-packages/keras/utils/generic_utils.py", line 142, in deserialize_keras_object
>     return cls.from_config(config['config'])
>   File "/home/bermads1/anaconda3/lib/python3.6/site-packages/keras/engine/topology.py", line 1253, in from_config
>     return cls(**config)
>   File "/home/bermads1/anaconda3/lib/python3.6/site-packages/keras_rcnn/layers/object_detection/_anchor.py", line 52, in __init__
>     super(Anchor, self).__init__(**kwargs)
>   File "/home/bermads1/anaconda3/lib/python3.6/site-packages/keras/engine/topology.py", line 280, in __init__
>     raise TypeError('Keyword argument not understood:', kwarg)
> TypeError: ('Keyword argument not understood:', 'allowed_border')
> 

I'm not sure how to proceed, as there are no functions or classes "allowed_border". Can anyone help?

@jhung0
Copy link
Contributor

jhung0 commented Mar 16, 2018 via email

@dberma15
Copy link
Author

Shouldn't saving the model save the weights?
Also, I can't train the model on the computer that I saved it because it would take too long.

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

2 participants