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

Dimension value must be integer or None or have an __index__ method, got 3.0 #27

Open
happy909 opened this issue Apr 28, 2021 · 0 comments

Comments

@happy909
Copy link

Traceback (most recent call last):
File "C:/Users/happy/PycharmProjects/Face-Aging-with-Identity-Preserved-Conditional-Generative-Adversarial-Networks-master/age_lsgan_transfer.py", line 173, in
tf.compat.v1.app.run()
File "C:\Users\happy\AppData\Roaming\Python\Python37\site-packages\tensorflow\python\platform\app.py", line 40, in run
_run(main=main, argv=argv, flags_parser=_parse_flags_tolerate_undef)
File "D:\python\lib\site-packages\absl\app.py", line 303, in run
_run_main(main, args)
File "D:\python\lib\site-packages\absl\app.py", line 251, in _run_main
sys.exit(main(argv))
File "C:/Users/happy/PycharmProjects/Face-Aging-with-Identity-Preserved-Conditional-Generative-Adversarial-Networks-master/age_lsgan_transfer.py", line 169, in main
my_train()
File "C:/Users/happy/PycharmProjects/Face-Aging-with-Identity-Preserved-Conditional-Generative-Adversarial-Networks-master/age_lsgan_transfer.py", line 91, in my_train
true_label_features_64, false_label_features_64, FLAGS.fea_layer_name, age_label)
File "C:\Users\happy\PycharmProjects\Face-Aging-with-Identity-Preserved-Conditional-Generative-Adversarial-Networks-master\models.py", line 186, in train_age_lsgan_transfer
self.face_age_alexnet(source_img_227, if_age=True)
File "C:\Users\happy\PycharmProjects\Face-Aging-with-Identity-Preserved-Conditional-Generative-Adversarial-Networks-master\models.py", line 71, in face_age_alexnet
conv1 = conv(x, 11, 11, 96, 4, 4, padding='VALID', name='conv1')
File "./tools\ops.py", line 57, in conv
weights = tf.get_variable('weights', shape=[filter_height, filter_width, input_channels / groups, num_filters])
File "C:\Users\happy\AppData\Roaming\Python\Python37\site-packages\tensorflow\python\ops\variable_scope.py", line 1573, in get_variable
aggregation=aggregation)
File "C:\Users\happy\AppData\Roaming\Python\Python37\site-packages\tensorflow\python\ops\variable_scope.py", line 1316, in get_variable
aggregation=aggregation)
File "C:\Users\happy\AppData\Roaming\Python\Python37\site-packages\tensorflow\python\ops\variable_scope.py", line 568, in get_variable
aggregation=aggregation)
File "C:\Users\happy\AppData\Roaming\Python\Python37\site-packages\tensorflow\python\ops\variable_scope.py", line 520, in _true_getter
aggregation=aggregation)
File "C:\Users\happy\AppData\Roaming\Python\Python37\site-packages\tensorflow\python\ops\variable_scope.py", line 851, in _get_single_variable
shape = tensor_shape.as_shape(shape)
File "C:\Users\happy\AppData\Roaming\Python\Python37\site-packages\tensorflow\python\framework\tensor_shape.py", line 1218, in as_shape
return TensorShape(shape)
File "C:\Users\happy\AppData\Roaming\Python\Python37\site-packages\tensorflow\python\framework\tensor_shape.py", line 771, in init
self._dims = [as_dimension(d) for d in dims_iter]
File "C:\Users\happy\AppData\Roaming\Python\Python37\site-packages\tensorflow\python\framework\tensor_shape.py", line 771, in
self._dims = [as_dimension(d) for d in dims_iter]
File "C:\Users\happy\AppData\Roaming\Python\Python37\site-packages\tensorflow\python\framework\tensor_shape.py", line 716, in as_dimension
return Dimension(value)
File "C:\Users\happy\AppData\Roaming\Python\Python37\site-packages\tensorflow\python\framework\tensor_shape.py", line 200, in init
None)
File "", line 3, in raise_from
TypeError: Dimension value must be integer or None or have an index method, got 3.0

Process finished with exit code 1
@dawei6875797 How to solve this problem when training the model please!!!

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

1 participant