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

cant Train the model #16

Open
farshidrayhancv opened this issue Jan 26, 2018 · 2 comments
Open

cant Train the model #16

farshidrayhancv opened this issue Jan 26, 2018 · 2 comments

Comments

@farshidrayhancv
Copy link

i used the following code in the terminal
python train.py 0
And I got the following errors

Traceback (most recent call last):' File "train.py", line 240, in
with tf.device(gpuNow):'

`File "/home/farshid/anaconda3/lib/python3.5/contextlib.py", line 59, in enter
return next(self.gen)'

File "/home/farshid/anaconda3/lib/python3.5/site-packages/tensorflow/python/framework/ops.py", line 3045, in device' device_function = pydev.merge_device(device_name_or_function)'

File "/home/farshid/anaconda3/lib/python3.5/site-packages/tensorflow/python/framework/device.py", line 282, in merge_device' spec = DeviceSpec.from_string(spec or "")'

File "/home/farshid/anaconda3/lib/python3.5/site-packages/tensorflow/python/framework/device.py", line 228, in from_string' return DeviceSpec().parse_from_string(spec)'

`File "/home/farshid/anaconda3/lib/python3.5/site-packages/tensorflow/python/framework/device.py", line 146, in parse_from_string'

splits = [x.split(":") for x in spec.split("/")]'AttributeError: 'int' object has no attribute 'split'
`

@nzurita
Copy link

nzurita commented Apr 20, 2018

Do you have a GPU or just a CPU? Another thing I noted is you are using python 3.5, while train.py is ready for python 2, the only issue I think is with print function, if you use python 3 it must have parenthesis: print('Training Begin') instead of print 'Training Begin'.

If you have a CPU and not GPU try changing line 240 from with tf.device(gpuNow): to:

with tf.device("/cpu:0"):

@farshidrayhancv
Copy link
Author

farshidrayhancv commented Apr 20, 2018 via email

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

2 participants