TypeError: makedirs() got an unexpected keyword argument 'exist_ok'

今天我跑了一个别人的深度学习模型,发现了一个奇怪的问题,查了一下原来makedirs()在python 2.x和python3.x有点区别,又是版本问题,遇见错误了,那么我就把它记录下来。


totalMemory: 1.95GiB freeMemory: 1.64GiB
2018-04-18 14:41:49.042748: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1120] Creating TensorFlow device (/device:GPU:0) -> (device: 0, name: GeForce GTX 760, pci bus id: 0000:01:00.0, compute capability: 3.0)
Traceback (most recent call last):
  File "deepFM.py", line 429, in <module>
    run()
  File "deepFM.py", line 425, in run
    single_run(feature_cnt, field_cnt, params)
  File "deepFM.py", line 183, in single_run
    os.makedirs(model_path, exist_ok=True)
TypeError: makedirs() got an unexpected keyword argument 'exist_ok'
 
 

把python2换成python3就完了。

python3 deepFM.py


参考文献

[1].makedirs() got an unexpected keyword argument 'exist_ok.

https://github.com/bamos/dcgan-completion.tensorflow/issues/20


猜你喜欢

转载自blog.csdn.net/w5688414/article/details/79990496