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: zeros_initializer() got multiple values for keyword argument 'dtype' #7496

Closed
wei-yuan opened this issue Feb 14, 2017 · 3 comments
Labels
stat:awaiting response Status - Awaiting response from author type:bug Bug

Comments

@wei-yuan
Copy link

wei-yuan commented Feb 14, 2017

I'm trying to do distributed learning from tutorial Inception in TensorFlow

Environment
Parameter Server
Operating system : Ubuntu 16.04 LTS
Tensorflow : r 0.12
python : 2.7.12

Worker
Operating system : CentOS 7
Tensorflow : r 0.12
python : 2.7.5
GPU card : 2 * GTX NVIDIA 1080

but i got this error :

Traceback (most recent call last): 
File "/home/paslab/tensorflow-models/inception/bazel-bin/inception/imagenet_distributed_train.runfiles/inception/inception/imagenet_distributed_train.py", line 66, in <module> tf.app.run()

File "/usr/lib/python2.7/site-packages/tensorflow/python/platform/app.py", line 44, in run _sys.exit(main(_sys.argv[:1] + flags_passthrough)) File "/home/paslab/tensorflow-models/inception/bazel-bin/inception/imagenet_distributed_train.runfiles/inception/inception/imagenet_distributed_train.py", line 62, in main inception_distributed_train.train(server.target, dataset, cluster_spec)

File "/home/paslab/tensorflow-models/inception/bazel-bin/inception/imagenet_distributed_train.runfiles/inception/inception/inception_distributed_train.py", line 120, in train global_step = slim.variables.global_step() 

File "/home/paslab/tensorflow-models/inception/bazel-bin/inception/imagenet_distributed_train.runfiles/inception/inception/slim/scopes.py", line 155, in func_with_args return func(*args, **current_args) 

File "/home/paslab/tensorflow-models/inception/bazel-bin/inception/imagenet_distributed_train.runfiles/inception/inception/slim/variables.py", line 244, in global_step trainable=False, collections=collections) 

File "/usr/lib/python2.7/site-packages/tensorflow/python/ops/variable_scope.py", line 987, in get_variable custom_getter=custom_getter) 

File "/usr/lib/python2.7/site-packages/tensorflow/python/ops/variable_scope.py", line 889, in get_variable custom_getter=custom_getter) 

File "/usr/lib/python2.7/site-packages/tensorflow/python/ops/variable_scope.py", line 347, in get_variable validate_shape=validate_shape) 

File "/usr/lib/python2.7/site-packages/tensorflow/python/ops/variable_scope.py", line 332, in _true_getter caching_device=caching_device, validate_shape=validate_shape) 

File "/usr/lib/python2.7/site-packages/tensorflow/python/ops/variable_scope.py", line 683, in _get_single_variable validate_shape=validate_shape) 

File "/usr/lib/python2.7/site-packages/tensorflow/python/ops/variables.py", line 226, in __init__ expected_shape=expected_shape) 

File "/usr/lib/python2.7/site-packages/tensorflow/python/ops/variables.py", line 303, in _init_from_args initial_value(), name="initial_value", dtype=dtype) 

File "/usr/lib/python2.7/site-packages/tensorflow/python/ops/variable_scope.py", line 672, in <lambda> shape.as_list(), dtype=dtype, partition_info=partition_info) 

TypeError: zeros_initializer() got multiple values for keyword argument 'dtype'

I checked the following issue before

(TypeError: ones_initializer() got multiple values for keyword argument 'dtype' when execute the inception_train #5742)

but it seems not working very well

Any idea? Thx!

@yaroslavvb
Copy link
Contributor

yaroslavvb commented Feb 14, 2017

Solution: #6202 (comment) (found by searching your issue title on github)

@wei-yuan
Copy link
Author

wei-yuan commented Feb 15, 2017

Hi @yaroslavvb ,


My environment info
Parameter Server
Operating system : Ubuntu 16.04 LTS
Tensorflow : r 0.12
Python : 2.7.12

Worker
Operating system : CentOS 7
Tensorflow : r 0.12
Python : 2.7.5
GPU card : 2 * GTX NVIDIA 1080


I already checked the file of ops.py, and my code here is

initializer=tf.ones_initializer()

So the problem seems not the initializer()
That's the reason i call for help :P
Should i use initializer=tf.constant_initializer() ?


EDIT : I'll check my firewall of worker, see if anything happen

@aselle aselle added type:bug Bug stat:awaiting response Status - Awaiting response from author labels Feb 15, 2017
@prb12
Copy link
Member

prb12 commented Mar 9, 2017

This tutorial was updated to the new TF1.0 API on Jan 20th tensorflow/models@e5079c8

You will need to upgrade to a newer version of TensorFlow to use this code without modification.

Please re-open if this does not fix your problem.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
stat:awaiting response Status - Awaiting response from author type:bug Bug
Projects
None yet
Development

No branches or pull requests

4 participants