lstm-char-cnn-tensorflow icon indicating copy to clipboard operation
lstm-char-cnn-tensorflow copied to clipboard

No module named 'TDNN'

Open Lolologist opened this issue 8 years ago • 3 comments

Using Python 3.5

I tried to run this project with its basic settings and cannot even run main.py as it claims there's a missing module. Though init.py in the models folder says it can't find TDNN, I verified that the file is indeed there.

C:\Users\dbishop\Desktop\lstm-char-cnn-tensorflow-master>python main.py --dataset ptb Traceback (most recent call last): File "main.py", line 5, in from models import LSTMTDNN File "C:\Users\dbishop\Desktop\lstm-char-cnn-tensorflow-master\models_init_.py", line 1, in from TDNN import TDNN ImportError: No module named 'TDNN'

Lolologist avatar Feb 08 '17 23:02 Lolologist

Issue seems to come from using python 3. The project claims to be python3 compatible, but I see xrange instead of range all over, and had to use python3-style imports to get around the issue above. How do I use this project with python 3?

Lolologist avatar Feb 09 '17 00:02 Lolologist

@Lolologist

Same issue occurs for me. Seems to be import issue. Solving this by: Change: from TDNN import TDNN to: from .TDNN import TDNN

there are also some other import statements you have to change too

qZhang88 avatar Mar 09 '17 14:03 qZhang88

@Lologist: I use python3.5, and still got the import error: No module named 'base', after following your suggestions.

jingweimo avatar Jun 24 '17 00:06 jingweimo