c - 在 C 中使用预训练的 pytorch 模型?

标签 c pytorch pre-trained-model

所以我有一个预训练的 pytorch 模型,我保存了模型和参数以防万一,但我需要在 C 或 C++ 代码中使用这个模型,有人知道我该怎么做吗?

非常感谢。

最佳答案

试试 pytorch 1.0,它包含一个 c++ 库。该模型可以导出为 torch 脚本格式并以 C++ 加载,请在此处查看 https://pytorch.org/tutorials/advanced/cpp_export.html

关于c - 在 C 中使用预训练的 pytorch 模型?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/51657294/

相关文章:

c - 在 'C' : How to clear the char array for the next string 中编程

c - 优雅的宏 if block

PyTorch 变换改变维度

python - 用于文本分类的预训练模型

c - 如何编写一个在迭代之间变化的字符串?

c - 在C中,node.next->prev与node->next->prev相同吗?

machine-learning - 如何使用注意掩码计算 HuggingFace Transformers BERT token 嵌入的平均值/最大值?

python - 如何在 autograd 反向传播中禁用某些模块的梯度更新?

缓存模块时找不到 Tensorflow Hub 目录

python - 使用 tf.keras 和 Inception-v3 进行迁移学习 : No training is happening