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: Value passed to parameter 'shape' has DataType float32 not in list of allowed values: int32, int64 #36

Open
birdflyto opened this issue Nov 19, 2019 · 1 comment

Comments

@birdflyto
Copy link

Traceback (most recent call last):
File "avg_runner.py", line 185, in
main()
File "avg_runner.py", line 177, in main
runner = AVGRunner(num_steps, load_path, num_test_rec)
File "avg_runner.py", line 40, in init
c.SCALE_FC_LAYER_SIZES_D)
File "C:\Users\tao-he\PycharmProjects\testing-pytorch\combustion\Adversarial_Video_Generation-master\Code\d_model.py", line 44, in init
self.define_graph()
File "C:\Users\tao-he\PycharmProjects\testing-pytorch\combustion\Adversarial_Video_Generation-master\Code\d_model.py", line 65, in define_graph
self.scale_fc_layer_sizes[scale_num]))
File "C:\Users\tao-he\PycharmProjects\testing-pytorch\combustion\Adversarial_Video_Generation-master\Code\d_scale_model.py", line 43, in init
self.define_graph()
File "C:\Users\tao-he\PycharmProjects\testing-pytorch\combustion\Adversarial_Video_Generation-master\Code\d_scale_model.py", line 76, in define_graph
self.conv_layer_fms[i + 1]]))
File "C:\Users\tao-he\PycharmProjects\testing-pytorch\combustion\Adversarial_Video_Generation-master\Code\tfutils.py", line 10, in w
return tf.int32(Variable(tf.random.truncated_normal(shape, stddev=stddev)))
NameError: name 'Variable' is not defined

C:\Users\tao-he\PycharmProjects\testing-pytorch\combustion\Adversarial_Video_Generation-master\Code>python avg_runner.py --test_dir=F:/zfg/Input/test/ --
name=F:/zfg/output/ --stats_freq=100 --summary_freq=100 --img_save_freq=100 --test_freq=2 --model_save_freq=100
C:\Users\tao-he\AppData\Roaming\Python\Python36\site-packages\tensorflow\python\framework\dtypes.py:516: FutureWarning: Passing (type, 1) or '1type' as a
synonym of type is deprecated; in a future version of numpy, it will be understood as (type, (1,)) / '(1,)type'.
_np_qint8 = np.dtype([("qint8", np.int8, 1)])
C:\Users\tao-he\AppData\Roaming\Python\Python36\site-packages\tensorflow\python\framework\dtypes.py:517: FutureWarning: Passing (type, 1) or '1type' as a
synonym of type is deprecated; in a future version of numpy, it will be understood as (type, (1,)) / '(1,)type'.
_np_quint8 = np.dtype([("quint8", np.uint8, 1)])
C:\Users\tao-he\AppData\Roaming\Python\Python36\site-packages\tensorflow\python\framework\dtypes.py:518: FutureWarning: Passing (type, 1) or '1type' as a
synonym of type is deprecated; in a future version of numpy, it will be understood as (type, (1,)) / '(1,)type'.
_np_qint16 = np.dtype([("qint16", np.int16, 1)])
C:\Users\tao-he\AppData\Roaming\Python\Python36\site-packages\tensorflow\python\framework\dtypes.py:519: FutureWarning: Passing (type, 1) or '1type' as a
synonym of type is deprecated; in a future version of numpy, it will be understood as (type, (1,)) / '(1,)type'.
_np_quint16 = np.dtype([("quint16", np.uint16, 1)])
C:\Users\tao-he\AppData\Roaming\Python\Python36\site-packages\tensorflow\python\framework\dtypes.py:520: FutureWarning: Passing (type, 1) or '1type' as a
synonym of type is deprecated; in a future version of numpy, it will be understood as (type, (1,)) / '(1,)type'.
_np_qint32 = np.dtype([("qint32", np.int32, 1)])
C:\Users\tao-he\AppData\Roaming\Python\Python36\site-packages\tensorflow\python\framework\dtypes.py:525: FutureWarning: Passing (type, 1) or '1type' as a
synonym of type is deprecated; in a future version of numpy, it will be understood as (type, (1,)) / '(1,)type'.
np_resource = np.dtype([("resource", np.ubyte, 1)])
C:\Users\tao-he\AppData\Roaming\Python\Python36\site-packages\tensorboard\compat\tensorflow_stub\dtypes.py:541: FutureWarning: Passing (type, 1) or '1typ
e' as a synonym of type is deprecated; in a future version of numpy, it will be understood as (type, (1,)) / '(1,)type'.
_np_qint8 = np.dtype([("qint8", np.int8, 1)])
C:\Users\tao-he\AppData\Roaming\Python\Python36\site-packages\tensorboard\compat\tensorflow_stub\dtypes.py:542: FutureWarning: Passing (type, 1) or '1typ
e' as a synonym of type is deprecated; in a future version of numpy, it will be understood as (type, (1,)) / '(1,)type'.
_np_quint8 = np.dtype([("quint8", np.uint8, 1)])
C:\Users\tao-he\AppData\Roaming\Python\Python36\site-packages\tensorboard\compat\tensorflow_stub\dtypes.py:543: FutureWarning: Passing (type, 1) or '1typ
e' as a synonym of type is deprecated; in a future version of numpy, it will be understood as (type, (1,)) / '(1,)type'.
_np_qint16 = np.dtype([("qint16", np.int16, 1)])
C:\Users\tao-he\AppData\Roaming\Python\Python36\site-packages\tensorboard\compat\tensorflow_stub\dtypes.py:544: FutureWarning: Passing (type, 1) or '1typ
e' as a synonym of type is deprecated; in a future version of numpy, it will be understood as (type, (1,)) / '(1,)type'.
_np_quint16 = np.dtype([("quint16", np.uint16, 1)])
C:\Users\tao-he\AppData\Roaming\Python\Python36\site-packages\tensorboard\compat\tensorflow_stub\dtypes.py:545: FutureWarning: Passing (type, 1) or '1typ
e' as a synonym of type is deprecated; in a future version of numpy, it will be understood as (type, (1,)) / '(1,)type'.
_np_qint32 = np.dtype([("qint32", np.int32, 1)])
C:\Users\tao-he\AppData\Roaming\Python\Python36\site-packages\tensorboard\compat\tensorflow_stub\dtypes.py:550: FutureWarning: Passing (type, 1) or '1typ
e' as a synonym of type is deprecated; in a future version of numpy, it will be understood as (type, (1,)) / '(1,)type'.
np_resource = np.dtype([("resource", np.ubyte, 1)])
2019-11-19 11:50:22.962937: I tensorflow/core/platform/cpu_feature_guard.cc:142] Your CPU supports instructions that this TensorFlow binary was not compi
led to use: AVX2
Init discriminator...
Traceback (most recent call last):
File "avg_runner.py", line 185, in
main()
File "avg_runner.py", line 177, in main
runner = AVGRunner(num_steps, load_path, num_test_rec)
File "avg_runner.py", line 40, in init
c.SCALE_FC_LAYER_SIZES_D)
File "C:\Users\tao-he\PycharmProjects\testing-pytorch\combustion\Adversarial_Video_Generation-master\Code\d_model.py", line 44, in init
self.define_graph()
File "C:\Users\tao-he\PycharmProjects\testing-pytorch\combustion\Adversarial_Video_Generation-master\Code\d_model.py", line 65, in define_graph
self.scale_fc_layer_sizes[scale_num]))
File "C:\Users\tao-he\PycharmProjects\testing-pytorch\combustion\Adversarial_Video_Generation-master\Code\d_scale_model.py", line 43, in init
self.define_graph()
File "C:\Users\tao-he\PycharmProjects\testing-pytorch\combustion\Adversarial_Video_Generation-master\Code\d_scale_model.py", line 95, in define_graph
self.fc_layer_sizes[i + 1]]))
File "C:\Users\tao-he\PycharmProjects\testing-pytorch\combustion\Adversarial_Video_Generation-master\Code\tfutils.py", line 10, in w
return tf.Variable(tf.random.truncated_normal(shape, stddev=stddev))
File "C:\Users\tao-he\AppData\Roaming\Python\Python36\site-packages\tensorflow\python\ops\random_ops.py", line 178, in truncated_normal
shape_tensor, dtype, seed=seed1, seed2=seed2)
File "C:\Users\tao-he\AppData\Roaming\Python\Python36\site-packages\tensorflow\python\ops\gen_random_ops.py", line 1063, in truncated_normal
name=name)
File "C:\Users\tao-he\AppData\Roaming\Python\Python36\site-packages\tensorflow\python\framework\op_def_library.py", line 626, in _apply_op_helper
param_name=input_name)
File "C:\Users\tao-he\AppData\Roaming\Python\Python36\site-packages\tensorflow\python\framework\op_def_library.py", line 60, in _SatisfiesTypeConstrain
t
", ".join(dtypes.as_dtype(x).name for x in allowed_list)))
TypeError: Value passed to parameter 'shape' has DataType float32 not in list of allowed values: int32, int64

hello, thanks for sharing the repo for us,but when i have finished the 1-3 steps and begin to start train on my own datasets,TypeError: Value passed to parameter 'shape' has DataType float32 not in list of allowed values: int32, int64 is coming, even i changed all the dtype into int,the type error still exited. I will appreciate it very much if you can help me with the error.

@free-4-ever
Copy link

@birdflyto
Hey, I wonder if you could get it solved for I'm facing the exact same problem... 🧐

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