sizhuoli / TreeCountSegHeight

Code for paper
Apache License 2.0
76 stars 14 forks source link

Error in loading models #6

Open amirsharifi97 opened 2 months ago

amirsharifi97 commented 2 months ago

I tried to load "trees_202106190148_Adam_e4_redgreenblueinfrared_256_84_frames_weightmapTversky_MSE100_5weight_attUNet.h5" model and others too for testing models on my input data but there is a problem in loading. Lambda layer has unknown shape and it can't be loaded by "load_model"! when I try loading model I get below error:

"We could not automatically infer the shape of the Lambda's output. Please specify the output_shape argument for this Lambda layer.

Arguments received by Lambda.call():
  • args=(['<KerasTensor shape=(None, 32, 32, 1024), dtype=float32, sparse=False, name=keras_tensor_338>', '<KerasTensor shape=(None, 32, 32, 512), dtype=float32, sparse=False, name=keras_tensor_345>'],)
  • kwargs={'mask': ['None', 'None']}"
sizhuoli commented 1 month ago

Hey,

I checked that this model could be loaded properly with the designated conda environment ([environment_trees_updated.yml]). The error with Lambda layer is often related to incompatible tensorflow versions. Please make sure that the correct version is installed.