KiseKloset / DM-VTON

👗 DM-VTON: Distilled Mobile Real-time Virtual Try-On
https://sites.google.com/view/ltnghia/research/DMVTON
Other
107 stars 23 forks source link

module 'cupy.cuda' has no attribute 'compile_with_cache' #15

Closed mirfan899 closed 5 months ago

mirfan899 commented 5 months ago

Here is the log of test command

python test.py --project runs/test --name DM-VTON_demo \
--device 0 --align_corners --batch_size 1 --workers 4 \
--dataroot ../dataset/VITON-Clean/VITON_test \
--pf_warp_checkpoint checkpoints/dmvton_pf_warp.pt \
--pf_gen_checkpoint checkpoints/dmvton_pf_gen.pt

Produces following error.

Load pretrained parser-free warp from checkpoints/dmvton_pf_warp.pt
Load pretrained parser-free gen from checkpoints/dmvton_pf_gen.pt
/opt/conda/envs/dm-vton/lib/python3.10/site-packages/torch/nn/functional.py:3782: UserWarning: nn.functional.upsample is deprecated. Use nn.functional.interpolate instead.
  warnings.warn("nn.functional.upsample is deprecated. Use nn.functional.interpolate instead.")
Traceback (most recent call last):
  File "/kaggle/working/DM-VTON/test.py", line 155, in <module>
    main(opt)
  File "/kaggle/working/DM-VTON/test.py", line 142, in main
    run_test_pf(
  File "/kaggle/working/DM-VTON/test.py", line 37, in run_test_pf
    warm_up(pipeline, **dummy_input)
  File "/kaggle/working/DM-VTON/utils/general.py", line 92, in warm_up
    _ = model(**dummy_input)
  File "/opt/conda/envs/dm-vton/lib/python3.10/site-packages/torch/nn/modules/module.py", line 1511, in _wrapped_call_impl
    return self._call_impl(*args, **kwargs)
  File "/opt/conda/envs/dm-vton/lib/python3.10/site-packages/torch/nn/modules/module.py", line 1520, in _call_impl
    return forward_call(*args, **kwargs)
  File "/kaggle/working/DM-VTON/pipelines/dmvton_pipeline.py", line 37, in forward
    flow_out = self.warp_model(person, clothes, phase=phase)
  File "/opt/conda/envs/dm-vton/lib/python3.10/site-packages/torch/nn/modules/module.py", line 1511, in _wrapped_call_impl
    return self._call_impl(*args, **kwargs)
  File "/opt/conda/envs/dm-vton/lib/python3.10/site-packages/torch/nn/modules/module.py", line 1520, in _call_impl
    return forward_call(*args, **kwargs)
  File "/kaggle/working/DM-VTON/models/warp_modules/mobile_afwm.py", line 331, in forward
    x_warp, last_flow = self.aflow_net(
  File "/opt/conda/envs/dm-vton/lib/python3.10/site-packages/torch/nn/modules/module.py", line 1511, in _wrapped_call_impl
    return self._call_impl(*args, **kwargs)
  File "/opt/conda/envs/dm-vton/lib/python3.10/site-packages/torch/nn/modules/module.py", line 1520, in _call_impl
    return forward_call(*args, **kwargs)
  File "/kaggle/working/DM-VTON/models/warp_modules/mobile_afwm.py", line 224, in forward
    tenCorrelation = FunctionCorrelation(
  File "/kaggle/working/DM-VTON/models/common/correlation.py", line 483, in FunctionCorrelation
    return _FunctionCorrelation.apply(tenFirst, tenSecond, intStride)
  File "/opt/conda/envs/dm-vton/lib/python3.10/site-packages/torch/autograd/function.py", line 553, in apply
    return super().apply(*args, **kwargs)  # type: ignore[misc]
  File "/kaggle/working/DM-VTON/models/common/correlation.py", line 339, in forward
    cupy_launch(
  File "cupy/_util.pyx", line 64, in cupy._util.memoize.decorator.ret
  File "/kaggle/working/DM-VTON/models/common/correlation.py", line 295, in cupy_launch
    return cupy.cuda.compile_with_cache(strKernel).get_function(strFunction)
  File "/opt/conda/envs/dm-vton/lib/python3.10/site-packages/cupy/cuda/__init__.py", line 84, in __getattr__
    raise AttributeError(
AttributeError: module 'cupy.cuda' has no attribute 'compile_with_cache'
mirfan899 commented 5 months ago

After updating the function using cupy.cuda.compile_with_cache with cupy.RawModule, I'm now getting this error

cupy_backends.cuda.api.driver.CUDADriverError: CUDA_ERROR_NOT_FOUND: named symbol not found

Changes made to fork is here.

https://github.com/mirfan899/DM-VTON
zero-nnkn commented 5 months ago

@mirfan899, thanks for your investigation. Fixed in #17