FastSAM icon indicating copy to clipboard operation
FastSAM copied to clipboard

POOR installation tutorial

Open starwave2 opened this issue 9 months ago • 2 comments

有人跟着Installation教程安装成功的吗? 教程里The code requires python>=3.7, as well as pytorch>=1.7 and torchvision>=0.8,如果装了python3.7,很多requirements的里的包就装不了,然后我尝试直接升级python从3.7到3.9,又被告知torchivision至少要0.11才支持python3.9 如果安装python3.9,并直接执行pip install -r requirements.txt,pytorch会报版本太高的错 In PyTorch 2.6, we changed the default value of the weights_only argument in torch.load from False to True. 于是我决定安装最低能兼容python3.9的pytorch和torchivion版本,结果又报错Could not find module 'anaconda3\envs\FastSAM\Lib\site-packages\torchvision\image.pyd'

Has anyone successfully installed it following the Installation tutorial? The tutorial requires python>=3.7, as well as pytorch>=1.7 and torchvision>=0.8. If I install Python 3.7, many of the packages in the requirements can't be installed. Then I tried to directly upgrade Python from 3.7 to 3.9, but I was informed that torchvision needs to be at least version 0.11 to support Python 3.9. If I install Python 3.9 and directly execute "pip install -r requirements.txt", there will be an error saying that the PyTorch version is too high as 'In PyTorch 2.6, we changed the default value of the weights_only argument in torch.load from False to True'. So I decided to install the lowest versions of PyTorch and Torchvision that are compatible with Python 3.9. However, I got another error: Could not find module 'anaconda3\envs\FastSAM\Lib\site-packages\torchvision\image.pyd'.

starwave2 avatar Apr 13 '25 12:04 starwave2

Same....Use torch 2.6 and modify: /fastsam/ultralytics/nn/tasks.py , add "weights_only=False" in line 518 torch.load

djqqqqqqqqqqq avatar Apr 24 '25 07:04 djqqqqqqqqqqq

https://github.com/CASIA-IVA-Lab/FastSAM/issues/271

nazar1ous avatar Jul 18 '25 15:07 nazar1ous