jittor报错,RuntimeError: Wrong inputs arguments, Please refer to examples(help(jt.item)).

[00:35<00:00, 4.41s/it]
[i 0518 00:18:24.721000 20 cuda_flags.cc:39] CUDA enabled.
用户输入: 一加一等于几?
[e 0518 00:19:41.320000 20 log.cc:565]
Traceback (most recent call last):
File “D:\myProgram\ideaJava\yiZhiXiangMuZu\Jittor\JittorLLMs\cli_demo.py”, line 9, in
model.chat()
File “D:\myProgram\ideaJava\yiZhiXiangMuZu\Jittor\JittorLLMs\models\chatglm_init_.py”, line 36, in chat
for response, history in self.model.stream_chat(self.tokenizer, text, history=history):
File “C:\Users\Administrator/.cache\huggingface\modules\transformers_modules\local\modeling_chatglm.py”, line 1259, in stream_chat
for outputs in self.stream_generate(**input_ids, **gen_kwargs):
File “C:\Users\Administrator/.cache\huggingface\modules\transformers_modules\local\modeling_chatglm.py”, line 1334, in stream_generate
model_inputs = self.prepare_inputs_for_generation(input_ids, **model_kwargs)
File “C:\Users\Administrator/.cache\huggingface\modules\transformers_modules\local\modeling_chatglm.py”, line 1083, in prepare_inputs_for_generation
mask_token = MASK if MASK in input_ids else gMASK
File “D:\Program Files\python39\python39\lib\site-packages\jittor\misc.py”, line 132, in contains
return bool((x == key).any())
File “D:\Program Files\python39\python39\lib\site-packages\jittor_init_.py”, line 2013, in to_bool
return ori_bool(v.item())
RuntimeError: Wrong inputs arguments, Please refer to examples(help(jt.item)).

Types of your inputs are:
self = Var,
args = (),

The function declarations are:
ItemData item()

Failed reason:[f 0518 00:19:41.322000 20 parallel_compiler.cc:330] Error happend during compilation:
[Error] source file location:C:\Users\Administrator.cache\jittor\jt1.3.7\cl\py3.9.13\Windows-10-10.x0c\11thGenIntelRCx42\default\cu11.2.67\jit__opkey0_array__T_int32__o_1__JIT_1__JIT_cuda_1__graph___var_info__21__index_t_int32_hash_81afca
ae637f9142_op.cc
Compile fused operator(0/3)failed:[Op(11991:0:1:1:i0:o1:s0,array->11992),]

Reason: [f 0518 00:19:41.320000 20 log.cc:608] Check failed ret(1) == 0(0) Run cmd failed: “C:\Users\Administrator.cache\jittor\jtcuda\cuda11.2_cudnn8_win\bin\nvcc.exe” “C:\Users\Administrator.cache\jittor\jt1.3.7\cl\py3.9.13\Windows-10-10
.x0c\11thGenIntelRCx42\default\cu11.2.67\jit__opkey0_array__T_int32__o_1__JIT_1__JIT_cuda_1__graph___var_info__21__index_t_int32_hash_81afcaae637f9142_op.cc” -shared -L"D:\Program Files\python39\python39\libs" -lpython39 -Xcomp
iler -EHa -Xcompiler -MD -Xcompiler -utf-8 -I"C:\Users\Administrator.cache\jittor\msvc\VC\include" -I"C:\Users\Administrator.cache\jittor\msvc\win10_kits\include\ucrt" -I"C:\Users\Administrator.cache\jittor\msvc\win10_kits\include\share
d" -I"C:\Users\Administrator.cache\jittor\msvc\win10_kits\include\um" -DNOMINMAX -L"C:\Users\Administrator.cache\jittor\msvc\VC\lib" -L"C:\Users\Administrator.cache\jittor\msvc\win10_kits\lib\um\x64" -L"C:\Users\Administrator.cache\jitt
or\msvc\win10_kits\lib\ucrt\x64" -I"d:\program files\python39\python39\lib\site-packages\jittor\src" -I"D:\Program Files\python39\python39\include" -DHAS_CUDA -DIS_CUDA -I"C:\Users\Administrator.cache\jittor\jtcuda\cuda11.2_cudnn8_win\incl
ude" -I"d:\program files\python39\python39\lib\site-packages\jittor\extern\cuda\inc" -lcudart -L"C:\Users\Administrator.cache\jittor\jtcuda\cuda11.2_cudnn8_win\lib\x64" -L"C:\Users\Administrator.cache\jittor\jtcuda\cuda11.2_cudnn8_win\bin
" -I"C:\Users\Administrator.cache\jittor\jt1.3.7\cl\py3.9.13\Windows-10-10.x0c\11thGenIntelRCx42\default\cu11.2.67" -L"C:\Users\Administrator.cache\jittor\jt1.3.7\cl\py3.9.13\Windows-10-10.x0c\11thGenIntelRCx42\default\cu11.2.67" -L"C:\Us
ers\Administrator.cache\jittor\jt1.3.7\cl\py3.9.13\Windows-10-10.x0c\11thGenIntelRCx42\default" -l"jit_utils_core.cp39-win_amd64" -l"jittor_core.cp39-win_amd64" -x cu --cudart=shared -ccbin=“C:\Users\Administrator.cache\jittor\msvc\VC_
____\bin\cl.exe” --use_fast_math -w -I"d:\program files\python39\python39\lib\site-packages\jittor\extern/cuda/inc" -arch=compute_75 -code=sm_75 -o “C:\Users\Administrator.cache\jittor\jt1.3.7\cl\py3.9.13\Windows-10-10.x0c\11thGenI
ntelRCx42\default\cu11.2.67\jit__opkey0_array__T_int32__o_1__JIT_1__JIT_cuda_1__graph___var_info__21__index_t_int32_hash_81afcaae637f9142_op.dll” -Xlinker -EXPORT:“?jit_run@FusedOp@jittor@@QEAAXXZ”

使用gpu,就出问题。只用cpu,就没问题。

注意:要只使用cpu,注释掉如下中的gpu代码:

if jt.has_cuda:
        self.model.half().cuda()
        print("haha,有 cuda")
    else:
        self.model.float32()
        torch.half = torch.float
        torch.Tensor.half = torch.Tensor.float
        # 上面三行,是else下面的
        print('用的cpu')

 使用如下命令,调试,看看能不能跑通:

python -m jittor.test.test_core

python -m jittor.test.test_cuda

如果这两个都没问题,估计就没问题。

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 2
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 2
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值