LLFlow icon indicating copy to clipboard operation
LLFlow copied to clipboard

onnx support

Open MaybeShewill-CV opened this issue 2 years ago • 1 comments

I wonder if the excellent model is able to converted into onnx ?

MaybeShewill-CV avatar Jun 10 '22 03:06 MaybeShewill-CV

Thanks for your interest in our work.

While I am unfamiliar with onnx, I believe the model can be converted, at least for inference. The model is purely built on Pytorch, and we do not need customized CUDA operation.

For training, we also utilize the vanilla auto propagation provided by PyTorch. We utilize a flag to control the behavior of each layer in our model.

wyf0912 avatar Jun 20 '22 14:06 wyf0912

When I try to export onnxtorch.onnx. export (model. netG, input_dummy, f, inputnames, outputnames. opset_version=11)or use the summary in torchsummary (model. netG), the following error will appear, indicating that x is empty in ConditionEncoder. py line 96. This means that there is no input information throughout the forward process. When I try to obtain input information using test. py, I still cannot import normally in forward mode. May I ask how the author should transmit the input information to the network if they want to operate normally in these two ways

  File "/root/miniconda3/lib/python3.8/site-packages/torch/cuda/amp/autocast_mode.py", line 141, in decorate_autocast
    return func(*args, **kwargs)
  File "/root/autodl-tmp/Model/LLFlow/code/models/modules/LLFlow_arch.py", line 97, in forward
    return self.normal_flow(gt, lr, epses=epses, lr_enc=lr_enc, add_gt_noise=add_gt_noise, step=step,
  File "/root/autodl-tmp/Model/LLFlow/code/models/modules/LLFlow_arch.py", line 121, in normal_flow
    lr_enc = self.rrdbPreprocessing(lr)
  File "/root/autodl-tmp/Model/LLFlow/code/models/modules/LLFlow_arch.py", line 182, in rrdbPreprocessing
    rrdbResults = self.RRDB(lr, get_steps=True)
  File "/root/miniconda3/lib/python3.8/site-packages/torch/nn/modules/module.py", line 1051, in _call_impl
    return forward_call(*input, **kwargs)
  File "/root/autodl-tmp/Model/LLFlow/code/models/modules/ConditionEncoder.py", line 96, in forward
    raw_low_input = x[:, 0:3].exp()
TypeError: 'NoneType' object is not subscriptable

yuchen02 avatar Jun 27 '23 05:06 yuchen02

我也遇到了相同的问题,请问您解决了吗

GaoTianWL avatar Nov 24 '23 02:11 GaoTianWL