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: run() got an unexpected keyword argument 'argv' #5643

Closed
kopxiong opened this issue Nov 16, 2016 · 30 comments
Closed

TypeError: run() got an unexpected keyword argument 'argv' #5643

kopxiong opened this issue Nov 16, 2016 · 30 comments
Labels
type:support Support issues

Comments

@kopxiong
Copy link

When I followed the TensorFlow Mechanics 101 tutorial python fully_connected_feed.py in examples/tutorials/mnist directory, I came across this problem:

Traceback (most recent call last):
  File "fully_connected_feed.py", line 277, in <module>
    tf.app.run(main=main, argv=[sys.argv[0]] + unparsed)
TypeError: run() got an unexpected keyword argument 'argv'

I am using tensorflow 0.11 version in Anaconda environment.

@girving
Copy link
Contributor

girving commented Nov 16, 2016

The argv argument was added recently: 6812d46. You are comparing a new version of a tutorial with an old version of tensorflow.

@girving girving closed this as completed Nov 16, 2016
@girving girving added the type:support Support issues label Nov 16, 2016
@marteiro
Copy link

I'm having the same problem. And i'm really using new example with old TF because the pip installation is not placing the examples files, so i've manually copied from sources and placed inside the pip installation.

I'm using the fallowing:
https://storage.googleapis.com/tensorflow/linux/cpu/tensorflow-0.11.0-cp27-none-linux_x86_64.whl

what should i use to get TF with examples?

thanks in advance.

@xinchenxp
Copy link

I've meet the same problem with lastest TF, does sb know how to fix this problem?Is there a new tutorial docuement that i can follow, thanks a lot !

Traceback (most recent call last):
File "convolutional.py", line 339, in
tf.app.run(main=main, argv=[sys.argv[0]] + unparsed)
TypeError: run() got an unexpected keyword argument 'argv'

@hokjoung
Copy link

Checkout the r0.11 branch instead of the master branch.
Use the tutorial code in that branch.

@xinchenxp
Copy link

Thanks a lot, i git the r0.11 banch eventually, and it works !

@marteiro
Copy link

Thanks, it worked. =D

@ttytt1978
Copy link

How to checkout the r0.11branch? my system is Ubuntu 16.04 LTS. Thanks.

@marteiro
Copy link

Use "-b r0.11" with Git clone!

@ttytt1978
Copy link

@marteiro Thanks,it worked.
Can solve this problem by Update Tensorflow to new version? How to update Tensorflow to new version?

@ttytt1978
Copy link

@girving
Can solve this problem by Update Tensorflow to new version? How to update Tensorflow to new version?

@marteiro
Copy link

@ttytt1978
If your are not contributing to the master branch, just use the r0.11. Not much else to hope for.

@loretoparisi
Copy link

I have the same error running the example in the learn folder:

on latest version 0.12:

https://github.com/tensorflow/tensorflow/blob/r0.12/tensorflow/examples/learn/text_classification.py

Traceback (most recent call last):
  File "text_classification.py", line 136, in <module>
    tf.app.run(main=main, argv=[sys.argv[0]] + unparsed)
TypeError: run() got an unexpected keyword argument 'argv'

@girving
Copy link
Contributor

girving commented Nov 22, 2016

@loretoparisi
Copy link

@girving sorry, didn't get. I'm using the text_classification.py example from the r0.12 blob, where I'm wrong?

@girving
Copy link
Contributor

girving commented Nov 22, 2016

@loretoparisi You are running text_classification.py from 0.12 against an older version of TensorFlow, which includes an older version of app.py which does not have the flag.

@loretoparisi
Copy link

@girving ok this makes sense, in fact my requirements.txt looks like

$ cat requirements.txt 
https://storage.googleapis.com/tensorflow/mac/cpu/tensorflow-0.11.0-py2-none-any.whl
matplotlib
nltk
sklearn
scipy
pandas

Thanks going to move to 0.12 nightly, if there is one?

@jubins
Copy link

jubins commented Nov 24, 2016

I am also getting the same error, how can I upgrade my tensorflow?

@loretoparisi
Copy link

@jubins for my understanding, the fix is in 0.12 but there is not nightly build in Jenkins already, the latest nightly build is here, but it is still on 0.11, so the only option I see so far is to move to branch r0.12 and compile from the scratch.

@jubins
Copy link

jubins commented Nov 24, 2016

@loretoparisi I recompiled my code using r0.12 but it now gives another error 'run() got an unexpected keyword argument argv'

screenshot from 2016-11-23 19-45-47

@vrv
Copy link

vrv commented Nov 24, 2016

Prior to 1.0, always make sure the tensorflow example code you run is from the same branch as the binary version you have installed.

So your options are:

  1. Upgrade your tensorflow installation (via nightly or source built from the same master branch) to use files in the master branch
  2. Check out the copy of the example code from the branch you have installed (For example: r0.11 if you have 0.11 installed, r0.10 if you have 0.10 installed).

Mixing and matching source code and binary install will likely cause you pain.

@ttytt1978
Copy link

I got it and it works,thanks!

@loretoparisi
Copy link

@ttytt1978 how you achieved that?
@vrv it could be useful a step by step guide, thanks.

@ttytt1978
Copy link

@loretoparisi
branche
Select the branch match you tensorflow version and download it, run the file in the directory you download.

@marteiro
Copy link

Please Dude, read the topic:

git clone https://github.com/tensorflow/tensorflow -b r0.11

@wei-yuan
Copy link

Thx a lot every one, it works!

@zcc973784075
Copy link

THX all! It helps a lot

@GarethZhang
Copy link

@girving Hi, im running tensorflow wheel version 0.10.0 with gpu support (cuda-7.5) and getting the same error. When I tried to branch to r11.0, it successfully installs wheel version 0.11.0 but prompts errors saying that it requires cuda-8.0 libraries. Whereas 0.10.0 only requires cuda-7.5. Do you know if there's another way to fix this error with cuda-7.5 libraries? Thanks!

@zhixinma
Copy link

Thanks, i try "-b r0.11" with Git clone and it works

@ghost
Copy link

ghost commented Feb 10, 2018

where to clone it

@Zo2m4bie
Copy link

Is this problem relevant to version 1.7.0? I installed tensorflow through pycharm and according to print(tf.version) my version is 1.7.0. However I faced the same problem

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

No branches or pull requests