Turning ESPNet into c++ cudastream problem
engineer1109 opened this issue · comments
I want to turn your python code into C++/Cuda Code.
So I want to convert your model into pt / ONNX model.
I found this conversion problem:
/home/wjl/project/ESPNetv2/segmentation/cnn/Model.py:139: TracerWarning: Converting a tensor to a Python boolean might cause the trace to be incorrect. We can't record the data flow of Python values, so this value will be treated as a constant in the future. This means that the trace might not generalize to other inputs!
if w2 == w1:
/home/wjl/project/ESPNetv2/segmentation/cnn/Model.py:91: TracerWarning: Converting a tensor to a Python boolean might cause the trace to be incorrect. We can't record the data flow of Python values, so this value will be treated as a constant in the future. This means that the trace might not generalize to other inputs!
if expanded.size() == input.size():
It seems "if ==" not support in cudastream, how can I avoid it?
We opted to create residual connections on-the-fly and it seems like this issue is related to the if condition responsible for the same. You can comment out the if condition (but don't comment the residual connection part) and I think it should work fine.