avobjects icon indicating copy to clipboard operation
avobjects copied to clipboard

Excuse me, error when running "python main.py --resume checkpoints/avobjects_loc_sep.pt --input_video demo.mp4 --output_dir demo_out"

Open zhang123-sys opened this issue 2 years ago • 1 comments

python main.py --resume checkpoints/avobjects_loc_sep.pt --input_video demo.mp4 --output_dir demo_out Using device: cuda rm demo_out/* -rf Checkpoint checkpoints/avobjects_loc_sep.pt loaded! Resampling media/demo.mp4 to 25 fps /opt/anaconda3/envs/avobjects/lib/python3.6/site-packages/torchvision/transforms/functional.py:405: UserWarning: Argument interpolation should be of type InterpolationMode instead of int. Please, use InterpolationMode enum. "Argument interpolation should be of type InterpolationMode instead of int. " Traceback (most recent call last): File "main.py", line 44, in main() File "main.py", line 41, in main trainer.eval(dataloader) File "/data0/audio_project/github/avobjects/trainer.py", line 60, in eval mel, _, _, _ = wav2filterbanks(audio.to(self.device)) File "/data0/audio_project/github/avobjects/load_audio.py", line 42, in wav2filterbanks onesided=True) # b x F x T x 2 File "/opt/anaconda3/envs/avobjects/lib/python3.6/site-packages/torch/functional.py", line 573, in stft normalized, onesided, return_complex) RuntimeError: stft input and window must be on the same device but got self on cuda:0 and window on cpu

zhang123-sys avatar Aug 02 '23 03:08 zhang123-sys

I faced the same issue and i forced device to CPU in below code in trainer.py. class DemoEvalTrainer():

def __init__(self, model, opts):
    self.model = model
    self.opts = opts

    **self.device = torch.device('cpu')#torch.device('cuda:0')**

pulkitmehtaworkmetacube avatar Dec 15 '23 06:12 pulkitmehtaworkmetacube