Hi. After finishing training my DDSP vocoder, I want to export it to ONNX, but I am getting the following error.
G:\HifiPLN\HiFiPLN>python export.py --config configs/ddsp.yaml --output out/ddsp --model logs\DDSP
Output path out\ddsp already exists, deleting
Exporting logs\DDSP\version_3\checkpoints\epoch=1091-step=1125000-loss=1.469.ckpt to out\ddsp
Exporting ONNX
Removed 1 parametrizations.
Model loaded
Traceback (most recent call last):
File "G:\HifiPLN\HiFiPLN\export.py", line 196, in
main(args.model, args.output, config, best=args.best, dynamo=args.dynamo)
File "G:\HifiPLN\HiFiPLN\export.py", line 159, in main
torch.onnx.export(
File "C:\Users\jaimo\AppData\Local\Programs\Python\Python310\lib\site-packages\torch\onnx\utils.py", line 516, in export
_export(
File "C:\Users\jaimo\AppData\Local\Programs\Python\Python310\lib\site-packages\torch\onnx\utils.py", line 1613, in _export
graph, params_dict, torch_out = _model_to_graph(
File "C:\Users\jaimo\AppData\Local\Programs\Python\Python310\lib\site-packages\torch\onnx\utils.py", line 1135, in _model_to_graph
graph, params, torch_out, module = _create_jit_graph(model, args)
File "C:\Users\jaimo\AppData\Local\Programs\Python\Python310\lib\site-packages\torch\onnx\utils.py", line 1011, in _create_jit_graph
graph, torch_out = _trace_and_get_graph_from_model(model, args)
File "C:\Users\jaimo\AppData\Local\Programs\Python\Python310\lib\site-packages\torch\onnx\utils.py", line 915, in _trace_and_get_graph_from_model
trace_graph, torch_out, inputs_states = torch.jit._get_trace_graph(
File "C:\Users\jaimo\AppData\Local\Programs\Python\Python310\lib\site-packages\torch\jit_trace.py", line 1296, in _get_trace_graph
outs = ONNXTracedModule(
File "C:\Users\jaimo\AppData\Local\Programs\Python\Python310\lib\site-packages\torch\nn\modules\module.py", line 1511, in _wrapped_call_impl
return self._call_impl(*args, **kwargs)
File "C:\Users\jaimo\AppData\Local\Programs\Python\Python310\lib\site-packages\torch\nn\modules\module.py", line 1520, in _call_impl
return forward_call(*args, **kwargs)
File "C:\Users\jaimo\AppData\Local\Programs\Python\Python310\lib\site-packages\torch\jit_trace.py", line 138, in forward
graph, out = torch._C._create_graph_by_tracing(
File "C:\Users\jaimo\AppData\Local\Programs\Python\Python310\lib\site-packages\torch\jit_trace.py", line 129, in wrapper
outs.append(self.inner(*trace_inputs))
File "C:\Users\jaimo\AppData\Local\Programs\Python\Python310\lib\site-packages\torch\nn\modules\module.py", line 1511, in _wrapped_call_impl
return self._call_impl(*args, **kwargs)
File "C:\Users\jaimo\AppData\Local\Programs\Python\Python310\lib\site-packages\torch\nn\modules\module.py", line 1520, in _call_impl
return forward_call(*args, **kwargs)
File "C:\Users\jaimo\AppData\Local\Programs\Python\Python310\lib\site-packages\torch\nn\modules\module.py", line 1501, in _slow_forward
result = self.forward(*input, **kwargs)
File "G:\HifiPLN\HiFiPLN\export.py", line 95, in forward
wav = wav.squeeze(1)
AttributeError: 'tuple' object has no attribute 'squeeze'
What can I do to solve this? Thanks in advance.