运行darts python train_search.py --unrolled

出现错误:

python 版本:

解决方法:https://blog.csdn.net/m0_37644085/article/details/92780697

原因:

  • python3.7已经移除了async关键字,而用non_blocking代替。(导致apache-airflow也出了问题)
  • cuda() 本身也没有async. 构造函数如下:

    cuda(device=None, non_blocking=False) → Tensor

 

解决办法:

  • 直接用cuda()
  • async_ 代替
  • 用non_blocking代替。ps:两个关键字(device and non_blocking)可以用来调用cuda( ) ,device是选取显卡序列号的。
    • non_blocking (bool):
      If True and the source is in pinned memory, the copy will be asynchronous with respect to the host. Otherwise, the argument has no effect. Default: False.
    • 如果为True且源位于锁定内存中,则副本将与主机异步。 否则,参数无效。 默认值:False。Always good to take a look at the Documentation:
  • 更新 Pipenv。 pip install pipenv  https://github.com/quark0/darts/pull/25 

https://pytorch.org/docs/stable/tensors.html#torch.Tensor.cuda 

 

我的解决方法:pip install pipenv

 直接使用cuda() 解决了这个问题

 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值