当前位置:   article > 正文

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

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

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


  1. totalMemory: 1.95GiB freeMemory: 1.64GiB
  2. 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)
  3. Traceback (most recent call last):
  4. File "deepFM.py", line 429, in <module>
  5. run()
  6. File "deepFM.py", line 425, in run
  7. single_run(feature_cnt, field_cnt, params)
  8. File "deepFM.py", line 183, in single_run
  9. os.makedirs(model_path, exist_ok=True)
  10. 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


声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/你好赵伟/article/detail/286548
推荐阅读
相关标签
  

闽ICP备14008679号