python - OSError unable to create file - invalid argument -
i using python , keras on top of tensorflow train neural networks. when switched ubuntu 16.04 windows 10, model not saved anymore when run following:
filepath = "checkpoint-"+str(f)+model_type+"-"+optimizer_name+"-{epoch:02d}-{loss:.3f}.hdf5" checkpoint = modelcheckpoint(filepath, monitor='loss', verbose=1, save_best_only=true, mode='min') callbacks_list = [checkpoint]
and later on:
model.fit(x, y, batch_size=128, epochs=1, shuffle=false, callbacks=callbacks_list)
i error:
oserror: unable create file (unable open file: name = 'checkpoint-<_io.textiowrapper name='data/swing-projects100-raw/many-chunks/log-gamma-f3.txt' mode='a' encoding='cp1252'>2l128-adam-0.001-{epoch:02d}-{loss:.3f}.h5', errno = 22, error message = 'invalid argument', flags = 13, o_flags = 302)
i have keras 2.0.8 , h5py 2.7.0 installed via conda.
i tried
filepath = "checkpoint-"+str(f)+model_type+"-"+optimizer_name+"-{epoch:02d}-{loss:.3f}.hdf5" open(filepath, "w") f: f.write("test.")
and got similar error:
oserror: [errno 22] invalid argument: "checkpoint-<_io.textiowrapper name='data/swing-projects100-raw/many-chunks/log-gamma-f3.txt' mode='a' encoding='cp1252'>2l128-adam-0.001-{epoch:02d}-{loss:.3f}.hdf5"
when removed str(f)
filepath, worked. f
integer , don't know why caused error, removing string solved problem.
let me know if know why.
Comments
Post a Comment