iitimii / Semantic-Segmentation-for-Clothing

Using a U-Net model to segment clothing items in an image
5 stars 0 forks source link

Error executing predict.py Cannot assign value to variable ' conv2d/kernel:0': Shape mismatch #1

Open Sladerix opened 8 months ago

Sladerix commented 8 months ago

Hi! i was trying to test your model but I got this error while executing the predict.py file

Traceback (most recent call last):
  File "/Users/antonellobarbone/Semantic-Segmentation-for-Clothing/predict.py", line 12, in <module>
    model.load_weights('big_last_model_weights.h5')
  File "/Users/antonellobarbone/Semantic-Segmentation-for-Clothing/venv/lib/python3.9/site-packages/keras/src/utils/traceback_utils.py", line 70, in error_handler
    raise e.with_traceback(filtered_tb) from None
  File "/Users/antonellobarbone/Semantic-Segmentation-for-Clothing/venv/lib/python3.9/site-packages/keras/src/backend.py", line 4359, in _assign_value_to_variable
    variable.assign(value)
ValueError: Cannot assign value to variable ' conv2d/kernel:0': Shape mismatch.The variable shape (3, 3, 3, 32), and the assigned value shape (64, 3, 3, 3) are incompatible.

What does it mean?

My packages:

absl-py==2.1.0
astunparse==1.6.3
cachetools==5.3.2
certifi==2023.11.17
charset-normalizer==3.3.2
contourpy==1.2.0
cycler==0.12.1
flatbuffers==23.5.26
fonttools==4.47.2
gast==0.5.4
google-auth==2.26.2
google-auth-oauthlib==1.2.0
google-pasta==0.2.0
grpcio==1.60.0
h5py==3.10.0
idna==3.6
importlib-metadata==7.0.1
importlib-resources==6.1.1
keras==2.15.0
kiwisolver==1.4.5
libclang==16.0.6
Markdown==3.5.2
MarkupSafe==2.1.4
matplotlib==3.8.2
ml-dtypes==0.2.0
numpy==1.26.3
oauthlib==3.2.2
opencv-python==4.9.0.80
opt-einsum==3.3.0
packaging==23.2
pandas==2.2.0
pillow==10.2.0
protobuf==4.23.4
pyasn1==0.5.1
pyasn1-modules==0.3.0
pyparsing==3.1.1
python-dateutil==2.8.2
pytz==2023.3.post1
requests==2.31.0
requests-oauthlib==1.3.1
rsa==4.9
six==1.16.0
tensorboard==2.15.1
tensorboard-data-server==0.7.2
tensorflow==2.15.0
tensorflow-estimator==2.15.0
tensorflow-io-gcs-filesystem==0.34.0
tensorflow-macos==2.15.0
termcolor==2.4.0
typing_extensions==4.9.0
tzdata==2023.4
urllib3==2.1.0
Werkzeug==3.0.1
wrapt==1.14.1
zipp==3.17.0

the image I'm trying with is appended demo_image

Shimmer-1 commented 8 months ago

i have the same problem like before one