gpt4 book ai didi

parallel-processing - pytorch : W ParallelNative. cpp:206

转载 作者:行者123 更新时间:2023-12-03 16:43:47 28 4
gpt4 key购买 nike

我正在尝试按照此处的教程在我的图像集上使用预先训练的模板:
https://pytorch.org/tutorials/beginner/finetuning_torchvision_models_tutorial.html
只有当我运行我的代码并且控制台锁定时,我总是得到这个“错误”:[W ParallelNative.cpp:206] Warning: Cannot set number of intraop threads after parallel work has started or after set_num_threads call when using native parallel backend (function set_num_threads) 预先感谢您的帮助,

最佳答案

我有同样的问题。
麦克。 Python 3.6(也在 3.8 上重现)。 pytorch 1.7。
似乎由于这个错误,数据加载器不(或不能)使用并行计算。
您可以通过两种方式消除错误(这不会解决问题)。

  • 如果您可以访问数据加载器,请设置 num_workers=0创建数据加载器时
  • 设置环境变量 export OMP_NUM_THREADS=1

  • 同样,这两种解决方案都会扼杀并行计算,并可能减慢数据加载(以及训练)速度。我期待 Pytorch 1.7 中的有效解决方案或补丁

    关于parallel-processing - pytorch : W ParallelNative. cpp:206,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/64772335/

    28 4 0
    Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
    广告合作:1813099741@qq.com 6ren.com