Open SteveIb opened 5 years ago
I'm not sure how I solved it, I think it was something related to paths or slash. something like that. Good luck!
I was getting a similar error. The solution is to fill up the concerned config.json file parameters. In my case, I had to input a non-null value for config[‘train’][‘saved_weights_name’]. Hope this helps.
modify f = h5dict(filepath, mode='w')
to
f = h5dict(str(filepath), mode='w')
Thankyou rohitbhio
**> modify f = h5dict(filepath, mode='w')
to
f = h5dict(str(filepath), mode='w')
**
In which file does this exist ?
Thankyou rohitbhio
where did you add the line of code proposed by rohitbhio ?
@HAMZARaouia , As you can see from the stack trace,
File "/usr/local/lib/python2.7/dist-packages/keras/engine/saving.py", line 379, in save_model.
This is where you need to make the modification.
File "train.py", line 101, in
main(args)
File "train.py", line 97, in main
debug = config['train']['debug'])
File "/home//Yolo2/keras-yolo2/frontend.py", line 336, in train
max_queue_size = 8)
File "/home//anaconda2/envs/py27/lib/python2.7/site-packages/keras/legacy/interfaces.py", line 91, in wrapper
return func(*args, kwargs)
File "/home//anaconda2/envs/py27/lib/python2.7/site-packages/keras/engine/training.py", line 1418, in fit_generator
initial_epoch=initial_epoch)
File "/home//anaconda2/envs/py27/lib/python2.7/site-packages/keras/engine/training_generator.py", line 250, in fit_generator
callbacks.on_epoch_end(epoch, epoch_logs)
File "/home//anaconda2/envs/py27/lib/python2.7/site-packages/keras/callbacks.py", line 79, in on_epoch_end
callback.on_epoch_end(epoch, logs)
File "/home//anaconda2/envs/py27/lib/python2.7/site-packages/keras/callbacks.py", line 446, in on_epoch_end
self.model.save(filepath, overwrite=True)
File "/home//anaconda2/envs/py27/lib/python2.7/site-packages/keras/engine/network.py", line 1090, in save
save_model(self, filepath, overwrite, include_optimizer)
File "/home//anaconda2/envs/py27/lib/python2.7/site-packages/keras/engine/saving.py", line 379, in save_model
f = h5dict(filepath, mode='w')
File "/home//anaconda2/envs/py27/lib/python2.7/site-packages/keras/utils/io_utils.py", line 195, in init
'Received: {}.'.format(type(path)))
TypeError: Required Group, str or dict. Received: <type 'unicode'>.