한국어 버전의 설명은 여기를 참고하시기 바랍니다.
This repository provides code to convert PyTorch models to TensorFlow.js (TFJS).
The overall process involves converting the model in the following order: PyTorch -> ONNX -> TensorFlow -> TensorFlow.js
.
- Shown in requirements.txt
- The most recent version of timm
# requirements.txt
pip install -r requirements.txt
# timm package install
pip install git+https://github.com/rwightman/pytorch-image-models.git
- PyTorch - ONNX - TensorFlow - TensorFlow.js
Let's assume that the trained PyTorch model is inside the outputs
folder with the following file tree structure:
pt2tfjs (repository)
├── src
└── outputs
└── ${ModelName}
├── ${ModelName}.pt
└── ${ModelName}.json
For the -n
option, you only need to provide the name of the folder containing the model inside the outputs
folder.
python3 src/pt2tfjs.py -n ${ModelName}
- models/pplcnet.py code is slightly changed from PP-LCNet.