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

ValueError: The last dimension of the inputs to Dense should be defined. Found None. #78

Open
Algabri opened this issue Mar 30, 2023 · 1 comment

Comments

@Algabri
Copy link

Algabri commented Mar 30, 2023

When I run training code for --model_type 2,3,5,6,8 and 9. Also, demo codes. I got this error:

Traceback (most recent call last):
  File "/home/redhwan/2/HPE/FSA-Net/demo/demo_FSANET_mtcnn.py", line 205, in <module>
    main()
  File "/home/redhwan/2/HPE/FSA-Net/demo/demo_FSANET_mtcnn.py", line 125, in main
    model1 = FSA_net_Capsule(image_size, num_classes,
  File "/home/redhwan/2/HPE/FSA-Net/demo/../lib/FSANET_model.py", line 431, in __call__
    ssr_S_model = self.ssr_S_model_build(num_primcaps=self.num_primcaps,m_dim=self.m_dim)           
  File "/home/redhwan/2/HPE/FSA-Net/demo/../lib/FSANET_model.py", line 370, in ssr_S_model_build
    feat_S_model = self.ssr_feat_S_model_build(m_dim)
  File "/home/redhwan/2/HPE/FSA-Net/demo/../lib/FSANET_model.py", line 360, in ssr_feat_S_model_build
    SR_matrix = Dense(m_dim*(self.map_xy_size*self.map_xy_size*3),activation='sigmoid')(feat_preS)
  File "/home/redhwan/.local/lib/python3.8/site-packages/tensorflow/python/keras/engine/base_layer.py", line 897, in __call__
    self._maybe_build(inputs)
  File "/home/redhwan/.local/lib/python3.8/site-packages/tensorflow/python/keras/engine/base_layer.py", line 2416, in _maybe_build
    self.build(input_shapes)  # pylint:disable=not-callable
  File "/home/redhwan/.local/lib/python3.8/site-packages/tensorflow/python/keras/layers/core.py", line 1154, in build
    raise ValueError('The last dimension of the inputs to `Dense` '
ValueError: The last dimension of the inputs to `Dense` should be defined. Found `None`.

tensorflow ==2.2.0

@Algabri
Copy link
Author

Algabri commented Mar 31, 2023

I fixed it by updating tensorflow ==2.2.0 to tensorflow ==2.3 and numpy-1.20.0

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