TorchEnsemble-Community / Ensemble-Pytorch

A unified ensemble framework for PyTorch to improve the performance and robustness of your deep learning model.
https://ensemble-pytorch.readthedocs.io
BSD 3-Clause "New" or "Revised" License
1.08k stars 95 forks source link

added map_location to the load function of torchensemble.utils.io #155

Closed AtiqurRahmanAni closed 11 months ago

AtiqurRahmanAni commented 1 year ago

Faced a problem when trying to load models on the CPU. When using io.load to load a model if cuda is not available, an error occurs. I added map_location to the load method to solve this issue. Now you can load models on the CPU. You need to do like io.load(......., map_location=torch.device('cpu')) if you want to load the model on the CPU.

xuyxu commented 11 months ago

@all-contributors please add @AtiqurRahmanAni for code

allcontributors[bot] commented 11 months ago

@xuyxu

I've put up a pull request to add @AtiqurRahmanAni! :tada:

xuyxu commented 11 months ago

Approved, sorry for missing this PR for more than a month. Thanks for your PR. @AtiqurRahmanAni

Could you remove the changes on CONTRIBUTORS.md in your PR? This would be automatically commited by the bot.