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

Pre-trained model weights no longer available #343

Open
Aecrionx opened this issue Jun 17, 2024 · 4 comments
Open

Pre-trained model weights no longer available #343

Aecrionx opened this issue Jun 17, 2024 · 4 comments
Labels
bug Something isn't working

Comments

@Aecrionx
Copy link

Pre-trained models found in the fastmri_examples are no longer accessible under the link below and returns an access-denied message. Is there another place we would be able to access model weights?

For example https://dl.fbaipublicfiles.com/fastMRI/trained_models/unet/unet_knee_sc returns

<Error>
<Code>AccessDenied</Code>
<Message>Access Denied</Message>
<RequestId>XXXXXXXXX</RequestId>
<HostId>YYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYY</HostId>
</Error>
@Aecrionx Aecrionx added the bug Something isn't working label Jun 17, 2024
@marinapapageorgiou
Copy link

I am having the same issue.
I cannot find the pretrained models. The links are not valid (https://dl.fbaipublicfiles.com/fastMRI/trained_models/unet/ , https://dl.fbaipublicfiles.com/fastMRI/trained_models/varnet/)

@mmuckley
Copy link
Contributor

Hello @marinapapageorgiou @Aecrionx, I think the right model should be at https://dl.fbaipublicfiles.com/fastMRI/trained_models/unet/knee_sc_leaderboard_state_dict.pt. You have to specify the full path or you will get the denied error.

@marinapapageorgiou
Copy link

Hello @marinapapageorgiou @Aecrionx, I think the right model should be at https://dl.fbaipublicfiles.com/fastMRI/trained_models/unet/knee_sc_leaderboard_state_dict.pt. You have to specify the full path or you will get the denied error.

Hello,
I said that the weights are missing because of this.

In the README.md file (fastMRI-main/fastmri_examples/unet) it says to run this for the pretrained models:
python run_pretrained_unet_inference.py
--data_path DATA
--output_path OUTPUTS
--challenge CHALLENGE

But the result is this:
/fastMRI-main/fastmri_examples/unet$ python run_pretrained_unet_inference.py --data_path /disk1/cs04757 --output_path /disk1/cs04757/fastMRI-main/fastmri_examples/unet/unet/unet_demo/reconstructions --challenge unet_knee_sc
/disk1/cs04757/fastMRI-main/fastmri_examples/unet/run_pretrained_unet_inference.py:73: FutureWarning: You are using torch.load with weights_only=False (the current default value), which uses the default pickle module implicitly. It is possible to construct malicious pickle data which will execute arbitrary code during unpickling (See https://github.com/pytorch/pytorch/blob/main/SECURITY.md#untrusted-models for more details). In a future release, the default value for weights_only will be flipped to True. This limits the functions that could be executed during unpickling. Arbitrary objects will no longer be allowed to be loaded via this mode unless they are explicitly allowlisted by the user via torch.serialization.add_safe_globals. We recommend you start setting weights_only=True for any use case where you don't have full control of the loaded file. Please open an issue on GitHub for any issues related to this experimental feature.
model.load_state_dict(torch.load(state_dict_file))
...

If the there were the weights, the weights_only parameter shouldn't be true? In my case is False. I did not change anything. I run it as the README.md said.

@mmuckley
Copy link
Contributor

mmuckley commented Oct 17, 2024

Hello @marinapapageorgiou, this is a new security feature of PyTorch to prevent someone who gave you a malicious file from taking over your computer. The run_pretrained_unet_inference.py script was written before this feature was introduced.

Since it's just a warning it looks like the script should still run. Did it run for you?

I've gone ahead and opened a separate issue for the weights_only flag related to your comment. Issue #348

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants