Keras-tuner search function throws Failed to create a NewWriteableFile error

前端 未结 3 1375
深忆病人
深忆病人 2021-01-06 15:17

The relatively new keras-tuner module for tensorflow-2 is causing the error \'Failed to create a NewWriteableFile\'. The tuner.search function is working, it is only after

相关标签:
3条回答
  • 2021-01-06 15:52

    In my case, the path exceeds the maximum length of path in windows because the length of generated path by Keras Turner is about 170. After I make my folder shorter, it works normally.

    0 讨论(0)
  • 2021-01-06 15:57

    I had the similas problem while using kerastuner in Windows and I've solved it:

    1. The first issue is that the path to the log directory may be too long. I had to reduced it.

    2. The second problem is that python (or tf) doens't work in Windows with mixed slashes. But kerastuner forms the path with backslashes. So I should provide the path with backslashes. I've done this with os.path.normpath() method:

    tuner=RandomSearch(build_model,objective='val_accuracy',max_trials=10,directory=os.path.normpath('C:/'))
    tuner.search(x_train,y_train,batch_size=256,epochs=30,validation_split=0.2,verbose=1)    
    

    Now I don't receive this error.

    0 讨论(0)
  • 2021-01-06 15:59

    The problem it would appear is a Windows issue. Running the same code in a Linux environment had no issue in this regard.

    0 讨论(0)
提交回复
热议问题