jittor icon indicating copy to clipboard operation
jittor copied to clipboard

FusedOp cannot contain both cpu and cuda ops

Open NickLennonLiu opened this issue 4 years ago • 3 comments

Describe the bug

在jittor_cuda的docker容器中运行“60分钟快速入门Jittor"的最后一个ipynb"计图入门教程3 --- 尝试解决一个实际问题”时,运行第23个cell(定义训练和测试函数并运行)时出现报错

Full Log

RuntimeError: Wrong inputs arguments, Please refer to examples(help(jt.data)).

Types of your inputs are: self = Var,

The function declarations are: inline DataView data()

Failed reason:[38;5;1m[f 0726 03:36:34.515950 52 fused_op.cc:172] Check failed: flags Something wrong... Could you please report this issue? FusedOp cannot contain both cpu and cuda ops.[m

RuntimeError Traceback (most recent call last) in 46 test_acc = list() 47 for epoch in range(epochs): ---> 48 loss = train(model, train_loader, loss_function, optimizer, epoch) # 训练模型,并返回该纪元的 Loss 列表 49 train_losses += loss 50 acc = test(model, val_loader, loss_function, epoch) # 测试模型,并返回该纪元的正确率

in train(model, train_loader, loss_function, optimizer, epoch) 14 print('Train Epoch: {} [{}/{} ({:.0f}%)]\tLoss: {:.6f}'.format( 15 epoch, batch_idx, len(train_loader), ---> 16 100. * batch_idx / len(train_loader), loss.data[0])) 17 return train_losses # 返回本纪元的 Loss 18

RuntimeError: Wrong inputs arguments, Please refer to examples(help(jt.data)).

Types of your inputs are: self = Var,

The function declarations are: inline DataView data()

Failed reason:[f 0726 03:36:34.515950 52 fused_op.cc:172] Check failed: flags Something wrong... Could you please report this issue? FusedOp cannot contain both cpu and cuda ops.

Minimal Reproduce

将jittor镜像中的“60分钟快速入门Jittor”文件夹拷贝到jittor_cuda镜像的容器中,并在有cuda支持的环境下运行。

Expected behavior

Cell正常运行通过

NickLennonLiu avatar Jul 26 '21 03:07 NickLennonLiu

感谢您的反馈,您试试将jittor更新一下呢,cuda里的jittor版本可能有点老,python3.7 -m pip install jittor -U

Jittor avatar Jul 26 '21 09:07 Jittor

您好,请问问题是否解决?如果已经解决,请问是如何解决的?

Crystal-yyy avatar Mar 16 '22 09:03 Crystal-yyy

您好,最新版本的jittor 1.3.1.53 已经彻底解决了该问题 ^_^

cjld avatar Mar 22 '22 14:03 cjld