Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TypeError: mkdir() got an unexpected keyword argument 'exist_ok' #98

Open
ricox78 opened this issue Nov 7, 2019 · 4 comments
Open

TypeError: mkdir() got an unexpected keyword argument 'exist_ok' #98

ricox78 opened this issue Nov 7, 2019 · 4 comments

Comments

@ricox78
Copy link

ricox78 commented Nov 7, 2019

Tried today to convert my h5 model but I have this:

sudo python keras_to_tensorflow.py --input_model="mymodel.h5" --output_model="mymodel.pb"
Using TensorFlow backend.
Traceback (most recent call last):
  File "keras_to_tensorflow.py", line 182, in <module>
    app.run(main)
  File "/usr/local/lib/python2.7/dist-packages/absl/app.py", line 300, in run
    _run_main(main, args)
  File "/usr/local/lib/python2.7/dist-packages/absl/app.py", line 251, in _run_main
    sys.exit(main(argv))
  File "keras_to_tensorflow.py", line 121, in main
    Path(output_model).parent.mkdir(parents=True, exist_ok=True)
TypeError: mkdir() got an unexpected keyword argument 'exist_ok'

Thank's for any help

@ricox78 ricox78 changed the title ypeError: mkdir() got an unexpected keyword argument 'exist_ok' TypeError: mkdir() got an unexpected keyword argument 'exist_ok' Nov 8, 2019
@jayveedee
Copy link

Same error. Did you ever get it fixed?

@OceanWong1991
Copy link

use Python3

@markfilan
Copy link

In some cases, if you are using older versions of Python, you will get the mkdir() got an unexpected keyword argument 'exists_ok' exception.

If you are using Python 3.5 or above, use pathlib.Path.mkdir:

from pathlib import Path
Path("/myDir/nested").mkdir(parents=True, exist_ok=True)
print("done")

@amir-abdi
Copy link
Owner

According to the documentation, exist_ok parameter was added in python 3.2.

New in version 3.2: The exist_ok parameter.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants