-
Notifications
You must be signed in to change notification settings - Fork 21
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
Problem in load_model function #1
Comments
Hi, Can you please specify which Tensorflow and Keras versions you are using? |
Keras 2.3.1 |
Can you try using Keras 2.2.4 and Tensorflow 1.12.0? I tested it out with those versions and it seemed to be working fine. |
this error happened to me because there is no pretrained model. you can find from description. |
When I ran 'detect_test_images.py' with Windows10, keras(2.2.4) and tensorflow(1.15.0), error occurred 'load_model' operation. The error was 'ValueError: Cannot create group in read only mode.'. In my case, I made 'checkpoints' directory and put your 'traffic-light-detection.h5' file in 'checkpoints' folder. How can I solve this problem? I also modified json file like below. {
} |
I have the same problem as @Kangsan-Jeon . |
Ok I could fix this issue. You need to access the model attribute of the YOLO class, e.g. as well as in the YOLO class the following lines: Now none of these classes loads the model and you can load the pretrained model as I described above. Hope this helps. |
hello, I get the following error, could you please help me about it? This function in the predict.py file; 1- def get_model_from_file(config): I get the error: SavedModel file does not exist at: C:\Users\90531\Source\Repos\traffic-light-detection-module\checkpoints\model.09-2.01.h5/{saved_model.pbtxt|saved_model.pb} |
I get the following error on running:
Traceback (most recent call last):
File "main.py", line 30, in
main(arg_parser.parse_args())
File "main.py", line 13, in main
yolo = YOLO(config)
File "/Users/shriyavanvari/Documents/SJSU/Semester 1/CMPE 257/CARLA/Code/traffic-light-detection-module/yolo.py", line 113, in init
self.feature_extractor = TinyYoloFeature(self.image_h, config).feature_extractor
File "/Users/shriyavanvari/Documents/SJSU/Semester 1/CMPE 257/CARLA/Code/traffic-light-detection-module/yolo.py", line 56, in init
pretrained = load_model('checkpoints/' + config['model']['saved_model_name'], custom_objects={'custom_loss': dummy_loss, 'tf': tf})
File "/Users/shriyavanvari/anaconda3/lib/python3.7/site-packages/keras/engine/saving.py", line 492, in load_wrapper
return load_function(*args, **kwargs)
File "/Users/shriyavanvari/anaconda3/lib/python3.7/site-packages/keras/engine/saving.py", line 584, in load_model
model = _deserialize_model(h5dict, custom_objects, compile)
File "/Users/shriyavanvari/anaconda3/lib/python3.7/site-packages/keras/engine/saving.py", line 270, in _deserialize_model
model_config = h5dict['model_config']
File "/Users/shriyavanvari/anaconda3/lib/python3.7/site-packages/keras/utils/io_utils.py", line 318, in getitem
raise ValueError('Cannot create group in read-only mode.')
ValueError: Cannot create group in read-only mode.
Can you please help out?
The text was updated successfully, but these errors were encountered: