vocal-remover icon indicating copy to clipboard operation
vocal-remover copied to clipboard

baseline relative path

Open rogermiranda1000 opened this issue 1 year ago • 7 comments

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

rogermiranda1000 avatar Nov 14 '22 16:11 rogermiranda1000

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

hykilpikonna avatar May 28 '23 20:05 hykilpikonna

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 avatar May 28 '23 20:05 rogermiranda1000

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))

rogermiranda1000 avatar Jun 30 '23 00:06 rogermiranda1000

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

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

Louis-wjh avatar Feb 15 '24 00:02 Louis-wjh

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

where is release folder?

Louis-wjh avatar Feb 15 '24 00:02 Louis-wjh

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

tsurumeso avatar Feb 15 '24 11:02 tsurumeso

@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.

rogermiranda1000 avatar Apr 01 '24 09:04 rogermiranda1000