RTNeural icon indicating copy to clipboard operation
RTNeural copied to clipboard

TensorFlow-like PyTorch export script

Open victorzappi opened this issue 7 months ago • 3 comments

  • Add script to export PyTorch models in same forrmat as TensorFlow

  • Add layers' names in TensorFlow export script

  • Add support for multi-output layers in TensorFlow script

victorzappi avatar Apr 18 '25 19:04 victorzappi

Thanks for making this PR! The Python changes look good... I'm debating whether to merge this PR before or after we add some tests for it. I'll have a look this weekend at what kind of tests I was to add, so I guess I'll make the decision then.

jatinchowdhury18 avatar Apr 24 '25 00:04 jatinchowdhury18

@victorzappi I've gone ahead and added tests for the output of the PyTorch exporter (see here). It's working well for the most part, but would it be possible to add support for the num_layers argument that PyTorch has for the GRU and LSTM layers? That's not part of the TensorFlow exporter, since the TensorFlow layers don't have any equivalent for that. The torch_helpers in RTNeural might be a useful reference for how the layers weights are organized when num_layers > 1 (https://github.com/jatinchowdhury18/RTNeural/blob/main/RTNeural/torch_helpers.h#L182).

jatinchowdhury18 avatar Apr 27 '25 05:04 jatinchowdhury18

@jatinchowdhury18 thanks for carrying out all the tests! I'll have a look into this next week probably.

victorzappi avatar May 14 '25 08:05 victorzappi