keras-team / keras

Deep Learning for humans
http://keras.io/
Apache License 2.0
62.14k stars 19.49k forks source link

Storing a model with a long file name fails. #12448

Closed jeongHwarr closed 5 years ago

jeongHwarr commented 5 years ago

Thank you for your awesome library.

I am having trouble saving the weight of the model.

I think there is a problem when the filename is long.

Error message model.save_weights(model_name, overwrite=True) *** OSError: Unable to create file (unable to open file: name = 'D:/Python_output/Speech_Emotion_Recognition_CNN_Capsule_Image_Decoder_RNN\datasets/IEMOCAP\SER-Capsule-Model-Toy-Improv-5cross-Valid-800-300-Low\model_data\00_model_lr_0.0005_routing_2_filter_size_3_11_filter_channel_8_16_primary_13_4_32_output_32_dense_256_512_linear.h5', errno = 2, error message = 'No such file or directory', flags = 13, o_flags = 302)

If the file name is shortened as follows, it will be saved successfully.

model.save_weights('D:/Python_output/Speech_Emotion_Recognition_CNN_Capsule_Image_Decoder_RNN\datasets/IEMOCAP\SER-Capsule-Model-Toy-Improv-5cross-Valid-800-300-Low\model_data\hello.h5')

Why does this problem occur? I want to solve it.

Thank you so much

OS: window 10 Keras version: 2.2.4

jvishnuvardhan commented 5 years ago

@jeonghwaYoo Windows 10 version has a restriction on path length. You need to remove that restriction as your pathlength is longer. Please check the resources here Thanks!

Please let me know your backend.

jvishnuvardhan commented 5 years ago

Closing due to lack of recent activity. Please update the issue when new information becomes available, and we will open a new issue. Thanks!