tsurumeso / vocal-remover

Vocal Remover using Deep Neural Networks
MIT License
1.55k stars 222 forks source link

baseline relative path #117

Closed rogermiranda1000 closed 2 months ago

rogermiranda1000 commented 1 year ago

I think that the program searches for ./models/baseline.pth, so if you run python3 vocal-remover/inference.py --input ... it won't work.

hykilpikonna commented 1 year ago

Download the zip from releases folder. baseline.pth is included there.

rogermiranda1000 commented 1 year ago

I think that the program searches for ./models/baseline.pth

@hykilpikonna what I mean is that you have to run the script in the same folder

if you run python3 vocal-remover/inference.py --input ... it won't work

rogermiranda1000 commented 1 year ago

The problem lies on the torch load (line 127), as it's a relative path. Changing it for something like this should work: model.load_state_dict(torch.load( os.path.join(os.path.dirname(os.path.abspath(__file__)), args.pretrained_model) , map_location=device))

Louis-wjh commented 7 months ago

我认为该程序搜索。/ models/baseline.pth,所以如果你运行python3 vocal-remover/inference.py --input ...,它将不起作用。

所以运行的时候报这个错误应该怎么解决?

Louis-wjh commented 7 months ago

Download the zip from releases folder. baseline.pth is included there.从releases文件夹下载zip。baseline.pth包含在其中。

where is release folder?

tsurumeso commented 7 months ago

Here it is. https://github.com/tsurumeso/vocal-remover/releases

rogermiranda1000 commented 6 months ago

@tsurumeso I think this issue has been misleading... I'm not complaining about "not being able to find the .pth"; as others said, you have to download it from the release. I'm complaining about "the program can't find the .pth, if it's not launched from the same base folder". You can try to go one directory up, and run python3 vocal-remover/inference.py --input ... you'll get an error. The PR https://github.com/tsurumeso/vocal-remover/pull/138 should fix that issue.