keras-yolo2 icon indicating copy to clipboard operation
keras-yolo2 copied to clipboard

after first iteration i get the following error

Open SteveIb opened this issue 6 years ago • 7 comments

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'>.

SteveIb avatar Oct 03 '18 15:10 SteveIb

I'm not sure how I solved it, I think it was something related to paths or slash. something like that. Good luck!

SteveIb avatar Feb 26 '19 09:02 SteveIb

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.

neurohn avatar Feb 27 '19 06:02 neurohn

modify f = h5dict(filepath, mode='w') to f = h5dict(str(filepath), mode='w')

rohitbhio avatar Feb 27 '19 08:02 rohitbhio

Thankyou rohitbhio

wilsonhermar avatar Apr 11 '19 17:04 wilsonhermar

**> modify f = h5dict(filepath, mode='w') to

f = h5dict(str(filepath), mode='w')**

In which file does this exist ?

HAMZARaouia avatar May 03 '19 16:05 HAMZARaouia

Thankyou rohitbhio

where did you add the line of code proposed by rohitbhio ?

HAMZARaouia avatar May 03 '19 16:05 HAMZARaouia

@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.

akb4797 avatar May 10 '19 09:05 akb4797