Open lmidriganciochina opened 1 year ago
It seems that maybe the model weights file is damaged. You can try to delete it (delete ~/.tractseg
) and then run it again. Then it will download the weights again, this time hopefully correctly.
Thank you so much for the suggestion! I did just that and it seems to work fine ! So thankful!
Hi experts, I am getting an error and I am not sure what it is due to, any suggestions are well appreciated!
Thank you! The code that I am running is:
cd ../template TractSeg -i template_peaks.nii.gz --output_type tract_segmentation TractSeg -i template_peaks.nii.gz --output_type endings_segmentation TractSeg -i template_peaks.nii.gz --output_type TOM TractSeg -i template_peaks.nii.gz Tracking -i template_peaks.nii.gz --tracking_format tck
Here is the error text: Loading weights from: /home/lmidriga/.tractseg/pretrained_weights_tract_segmentation_v3.npz Traceback (most recent call last): File "/home/lmidriga/anaconda3/envs/python3.9env/bin/TractSeg", line 420, in
main()
File "/home/lmidriga/anaconda3/envs/python3.9env/bin/TractSeg", line 325, in main
seg = run_tractseg(data, args.output_type,
File "/home/lmidriga/anaconda3/envs/python3.9env/lib/python3.9/site-packages/tractseg/python_api.py", line 157, in run_tractseg
model = BaseModel(Config, inference=True)
File "/home/lmidriga/anaconda3/envs/python3.9env/lib/python3.9/site-packages/tractseg/models/base_model.py", line 106, in init
self.load_model(join(self.Config.EXP_PATH, self.Config.WEIGHTS_PATH))
File "/home/lmidriga/anaconda3/envs/python3.9env/lib/python3.9/site-packages/tractseg/models/base_model.py", line 280, in load_model
pytorch_utils.load_checkpoint(path, unet=self.net)
File "/home/lmidriga/anaconda3/envs/python3.9env/lib/python3.9/site-packages/tractseg/libs/pytorch_utils.py", line 20, in load_checkpoint
checkpoint = torch.load(path, map_location=lambda storage, loc: storage)
File "/home/lmidriga/anaconda3/envs/python3.9env/lib/python3.9/site-packages/torch/serialization.py", line 815, in load
return _legacy_load(opened_file, map_location, pickle_module, **pickle_load_args)
File "/home/lmidriga/anaconda3/envs/python3.9env/lib/python3.9/site-packages/torch/serialization.py", line 1051, in _legacy_load
typed_storage._untyped_storage._set_from_file(
RuntimeError: unexpected EOF, expected 1358507 more bytes. The file might be corrupted.
Reorienting data...
Loading weights from: /home/lmidriga/.tractseg/pretrained_weights_endings_segmentation_v4.npz
Processing direction (1 of 3)
100%|████████████████████████████████████████████████████████████████████████████| 144/144 [00:11<00:00, 12.77it/s]
Processing direction (2 of 3)
100%|████████████████████████████████████████████████████████████████████████████| 144/144 [00:11<00:00, 13.03it/s]
Processing direction (3 of 3)
100%|████████████████████████████████████████████████████████████████████████████| 144/144 [00:10<00:00, 13.61it/s]
^CTraceback (most recent call last):
File "/home/lmidriga/anaconda3/envs/python3.9env/bin/TractSeg", line 420, in
main()
File "/home/lmidriga/anaconda3/envs/python3.9env/bin/TractSeg", line 325, in main
seg = run_tractseg(data, args.output_type,
File "/home/lmidriga/anaconda3/envs/python3.9env/lib/python3.9/site-packages/tractseg/python_api.py", line 169, in run_tractseg
segxyz, = direction_merger.get_seg_single_img_3_directions(Config, model, data=data,
File "/home/lmidriga/anaconda3/envs/python3.9env/lib/python3.9/site-packages/tractseg/libs/direction_merger.py", line 27, in get_seg_single_img_3_directions
img_probs, img_y = trainer.predict_img(Config, model, dataManagerSingle, probs=True,
File "/home/lmidriga/anaconda3/envs/python3.9env/lib/python3.9/site-packages/tractseg/libs/trainer.py", line 319, in predict_img
layers_seg = _finalize_data(layers_seg)
File "/home/lmidriga/anaconda3/envs/python3.9env/lib/python3.9/site-packages/tractseg/libs/trainer.py", line 222, in _finalize_data
layers = np.array(layers)
KeyboardInterrupt
Thank you so much!