Closed sanjaykhobragade closed 4 years ago
It looks like you may be using the single-image model weights with the exam-level model script. Your model_path should look like models/sample_image_model.p
rather than models/ImageOnly__ModeImage_weights.p
. Can you verify this?
Thx for response, @zphang Yes, I had IMAGE_MODEL_PATH='models/ImageOnly__ModeImage_weights.p'. So, instead I should change it to 'models/sample_image_model.p' ?
And IMAGEHEATMAPS_MODEL_PATH is defined as 'models/ImageHeatmaps__ModeImage_weights.p'. Should this be 'sample_imageheatmaps_model.p' instead?
There are two separate scripts: run.sh
and run_single.sh
. It looks like you're getting the configurations mixed between them. Both scripts should have the correct image model paths at the top of the script.
Yes, that indeed was the case. Thank you! This issue can be closed.
With Device_type = 'cpu', I am getting below error during running 'Stage 4a: Run Classifier (Image)' stage.
Traceback (most recent call last): File "src/modeling/run_model.py", line 238, in
main()
File "src/modeling/run_model.py", line 233, in main
parameters=parameters,
File "src/modeling/run_model.py", line 188, in load_run_save
model, device = load_model(parameters)
File "src/modeling/run_model.py", line 51, in load_model
model.load_state_dict(torch.load(parameters["model_path"])["model"])
File "/usr/local/envs/py3env/lib/python3.5/site-packages/torch/nn/modules/module.py", line 839, in load_state_dict
self.class.name, "\n\t".join(error_msgs)))
RuntimeError: Error(s) in loading state_dict for SplitBreastModel:
Missing key(s) in state_dict: "fc1_cc.weight", "fc1_cc.bias", "fc1_mlo.weight", "fc1_mlo.bias", "output_layer_cc.fc_layer.weight", "output_layer_cc.fc_layer.bias", "output_layer_mlo.fc_layer.weight", "output_layer_mlo.fc_layer.bias".
Unexpected key(s) in state_dict: "fc1_lcc.weight", "fc1_lcc.bias", "fc1_rcc.weight", "fc1_rcc.bias", "fc1_lmlo.weight", "fc1_lmlo.bias", "fc1_rmlo.weight", "fc1_rmlo.bias", "output_layer_lcc.fc_layer.weight", "output_layer_lcc.fc_layer.bias", "output_layer_rcc.fc_layer.weight", "output_layer_rcc.fc_layer.bias", "output_layer_lmlo.fc_layer.weight", "output_layer_lmlo.fc_layer.bias", "output_layer_rmlo.fc_layer.weight", "output_layer_rmlo.fc_layer.bias".