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

When I run train.py, I got an import Error #28

Closed
Hydraz320 opened this issue Mar 28, 2017 · 5 comments
Closed

When I run train.py, I got an import Error #28

Hydraz320 opened this issue Mar 28, 2017 · 5 comments

Comments

@Hydraz320
Copy link

Traceback (most recent call last):
File "train.py", line 18, in
import commentjson
File "C:\Users\hydraz320\Anaconda3\lib\site-packages\commentjson_init_.py", line 1, in
from commentjson import dump
ImportError: cannot import name 'dump'

May I ask that which os you were using? Thanks a lot.

@MarvinTeichmann
Copy link
Owner

This seams to be an issue with your commentjson version. I am using Vesion commentjson==0.6.

A work around would be to replace from commentjson import dump with from json import dump. You can't use comments in the config file then. However KittiSeg currently does not have any comments in it, so it will work out of the box.

@WPSanberg
Copy link

WPSanberg commented Apr 6, 2017

Hi, I am using commentjson 0.6 as well, but I get the same error. It might be windows (although I'm on Debian 4.9.13-1) and/or python>3.4 related, see https://github.com/vaidik/commentjson/issues/3.

I have used your workaround (simply using json instead of commentjson in train.py) and it does not complain anymore, but it might have led to a different problem. I'll submit a separate issue for that in case it's unrelated.

@lemhell
Copy link

lemhell commented Apr 8, 2017

@WPSanberg
Hello, I've been getting the same error, then it was suggested in the Issue 8 to use Python 2.7, I installed everything for 2.7 and the issue was resolved for me.

@Hydraz320
Copy link
Author

Well, I use python2.7 and ubuntu16.04 and get the expected results.

@MarvinTeichmann
Copy link
Owner

ok. This issue seams to be fixed. So I close it for now.

Regarding commentjson: I properly should look for an alternative if it does not work with python 3.4. In practise this is a minor think. In theory json could be used and/or any wrapper which removes comments.

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

4 participants