Giter Club home page Giter Club logo

Comments (3)

xinntao avatar xinntao commented on July 28, 2024 1
  1. on windows conda: you may need to check the BASICSR_JIT env variable. You can check in BasicSR:
    image

Or you can force using the cuda ops building at runtime.

  1. Google colab: RuntimeError: input must be a CUDA tensor

check whether put the tensor to GPU.

from gfpgan.

xinntao avatar xinntao commented on July 28, 2024

I have not tried on Windows for training.
It seems that you have not installed NCCL or you have installed a pytorch version that does not build with nccl.

BTW, if you only have one GPU, you may not use distributed training.

from gfpgan.

 avatar commented on July 28, 2024

No idea what I am doing wrong. Under Windows or in Google Colab come only Errors when trying to train.
The inference_gfpgan.py works under Windows and Google Colab. With other projects e.g. Nvidia Stylegan2-ADA Pytorch etc. it works with cuda ops build at runtime.

Error on Win 10 with Conda:
set BASICSR_JIT=True && python gfpgan\train.py -opt c:\Users\Chaos\Downloads\test.yml
or
python gfpgan\train.py -opt c:\Users\Chaos\Downloads\test.yml

2021-08-11 10:36:58,307 INFO: Model [GFPGANModel] is created.
2021-08-11 10:37:05,481 INFO: Start training from epoch: 0, iter: 0
Traceback (most recent call last):
File "gfpgan\train.py", line 11, in
train_pipeline(root_path)
File "C:\Users\Chaos\miniconda3\envs\GFPGAN\lib\site-packages\basicsr\train.py", line 167, in train_pipeline
model.optimize_parameters(current_iter)
File "d:!_ai!_repo\gfpgan\gfpgan\models\gfpgan_model.py", line 305, in optimize_parameters
self.output, out_rgbs = self.net_g(self.lq, return_rgb=True)
File "C:\Users\Chaos\miniconda3\envs\GFPGAN\lib\site-packages\torch\nn\modules\module.py", line 1051, in _call_impl
return forward_call(*input, **kwargs)
File "d:!_ai!_repo\gfpgan\gfpgan\archs\gfpganv1_arch.py", line 347, in forward
feat = self.conv_body_first(x)
File "C:\Users\Chaos\miniconda3\envs\GFPGAN\lib\site-packages\torch\nn\modules\module.py", line 1051, in _call_impl
return forward_call(*input, **kwargs)
File "C:\Users\Chaos\miniconda3\envs\GFPGAN\lib\site-packages\torch\nn\modules\container.py", line 139, in forward
input = module(input)
File "C:\Users\Chaos\miniconda3\envs\GFPGAN\lib\site-packages\torch\nn\modules\module.py", line 1051, in _call_impl
return forward_call(*input, **kwargs)
File "C:\Users\Chaos\miniconda3\envs\GFPGAN\lib\site-packages\basicsr\ops\fused_act\fused_act.py", line 91, in forward
return fused_leaky_relu(input, self.bias, self.negative_slope, self.scale)
File "C:\Users\Chaos\miniconda3\envs\GFPGAN\lib\site-packages\basicsr\ops\fused_act\fused_act.py", line 95, in fused_leaky_relu
return FusedLeakyReLUFunction.apply(input, bias, negative_slope, scale)
File "C:\Users\Chaos\miniconda3\envs\GFPGAN\lib\site-packages\basicsr\ops\fused_act\fused_act.py", line 65, in forward
out = fused_act_ext.fused_bias_act(input, bias, empty, 3, 0, negative_slope, scale)
NameError: name 'fused_act_ext' is not defined

Error on Google Colab:
!BASICSR_JIT=True python gfpgan/train.py -opt /content/test.yml

2021-08-11 08:33:04,594 INFO: Model [GFPGANModel] is created.
2021-08-11 08:33:04,654 INFO: Start training from epoch: 0, iter: 0
Traceback (most recent call last):
File "gfpgan/train.py", line 11, in
train_pipeline(root_path)
File "/usr/local/lib/python3.7/dist-packages/basicsr/train.py", line 167, in train_pipeline
model.optimize_parameters(current_iter)
File "/content/GFPGAN/gfpgan/models/gfpgan_model.py", line 305, in optimize_parameters
self.output, out_rgbs = self.net_g(self.lq, return_rgb=True)
File "/usr/local/lib/python3.7/dist-packages/torch/nn/modules/module.py", line 1051, in _call_impl
return forward_call(*input, **kwargs)
File "/content/GFPGAN/gfpgan/archs/gfpganv1_arch.py", line 347, in forward
feat = self.conv_body_first(x)
File "/usr/local/lib/python3.7/dist-packages/torch/nn/modules/module.py", line 1051, in _call_impl
return forward_call(*input, **kwargs)
File "/usr/local/lib/python3.7/dist-packages/torch/nn/modules/container.py", line 139, in forward
input = module(input)
File "/usr/local/lib/python3.7/dist-packages/torch/nn/modules/module.py", line 1051, in _call_impl
return forward_call(*input, **kwargs)
File "/usr/local/lib/python3.7/dist-packages/basicsr/ops/fused_act/fused_act.py", line 91, in forward
return fused_leaky_relu(input, self.bias, self.negative_slope, self.scale)
File "/usr/local/lib/python3.7/dist-packages/basicsr/ops/fused_act/fused_act.py", line 95, in fused_leaky_relu
return FusedLeakyReLUFunction.apply(input, bias, negative_slope, scale)
File "/usr/local/lib/python3.7/dist-packages/basicsr/ops/fused_act/fused_act.py", line 65, in forward
out = fused_act_ext.fused_bias_act(input, bias, empty, 3, 0, negative_slope, scale)
RuntimeError: input must be a CUDA tensor

Error on Google Colab:
!python gfpgan/train.py -opt /content/test.yml

2021-08-11 08:35:29,867 INFO: Model [GFPGANModel] is created.
2021-08-11 08:35:29,924 INFO: Start training from epoch: 0, iter: 0
Traceback (most recent call last):
File "gfpgan/train.py", line 11, in
train_pipeline(root_path)
File "/usr/local/lib/python3.7/dist-packages/basicsr/train.py", line 167, in train_pipeline
model.optimize_parameters(current_iter)
File "/content/GFPGAN/gfpgan/models/gfpgan_model.py", line 305, in optimize_parameters
self.output, out_rgbs = self.net_g(self.lq, return_rgb=True)
File "/usr/local/lib/python3.7/dist-packages/torch/nn/modules/module.py", line 1051, in _call_impl
return forward_call(*input, **kwargs)
File "/content/GFPGAN/gfpgan/archs/gfpganv1_arch.py", line 347, in forward
feat = self.conv_body_first(x)
File "/usr/local/lib/python3.7/dist-packages/torch/nn/modules/module.py", line 1051, in _call_impl
return forward_call(*input, **kwargs)
File "/usr/local/lib/python3.7/dist-packages/torch/nn/modules/container.py", line 139, in forward
input = module(input)
File "/usr/local/lib/python3.7/dist-packages/torch/nn/modules/module.py", line 1051, in _call_impl
return forward_call(*input, **kwargs)
File "/usr/local/lib/python3.7/dist-packages/basicsr/ops/fused_act/fused_act.py", line 91, in forward
return fused_leaky_relu(input, self.bias, self.negative_slope, self.scale)
File "/usr/local/lib/python3.7/dist-packages/basicsr/ops/fused_act/fused_act.py", line 95, in fused_leaky_relu
return FusedLeakyReLUFunction.apply(input, bias, negative_slope, scale)
File "/usr/local/lib/python3.7/dist-packages/basicsr/ops/fused_act/fused_act.py", line 65, in forward
out = fused_act_ext.fused_bias_act(input, bias, empty, 3, 0, negative_slope, scale)
NameError: name 'fused_act_ext' is not defined

from gfpgan.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.