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

系统提示:“用户输入: ”,我在后面输入“ 一加一等于几?”,报错,RuntimeError: Wrong inputs arguments, Please refer to examples(help(jt.item))。这里该如何输入?help(jt.item) 又该如何用?谢谢

Loading checkpoint shards: 100%|██████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 8/8 [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的原因。如果把cuda部分注释掉,全部用cpu跑,没有问题,就是慢。我的gpu只有2g,我设置了 device_mem_limit=1500000000 ,不知道哪里出了问题。
class ChatGLMMdoel(LLMModel):
def init(self, args) → None:
super().init()
self.tokenizer = AutoTokenizer.from_pretrained(os.path.dirname(file), trust_remote_code=True)
self.model = AutoModel.from_pretrained(os.path.dirname(file), trust_remote_code=True)

    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')

如下代码,能正确返回 CUDA is available!
import torch

if torch.cuda.is_available():
print(“CUDA is available!”)
else:
print(“CUDA is not available.”)
谢谢

Failed reason:[f 0518 10:22:35.649000 36 parallel_compiler.cc:330] Error happend during compilation:
[Error] source file location:D:\JITTOR_HOME.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_81afcaae637f91
42_op.cc
Compile fused operator(0/3)failed:[Op(11991:0:1:1:i0:o1:s0,array->11992){D:\myProgram\ideaJava\yiZhiXiangMuZu\Jittor\JittorLLMs\cli_demo.py:9() → D:\myProgram\ideaJava\yiZhiXiangMuZu\Jittor\JittorLLMs\models\chatglm_init
.py:42(c
hat) → C:\Users\Administrator/.cache\huggingface\modules\transformers_modules\local\modeling_chatglm.py:1259(stream_chat) → C:\Users\Administrator/.cache\huggingface\modules\transformers_modules\local\modeling_chatglm.py:1331(stream_genera
te) → D:\Program Files\python39\python39\lib\site-packages\jittor\init.py:113(constant_) → D:\Program Files\python39\python39\lib\site-packages\jittor\init.py:90(constant) → D:\Program Files\python39\python39\lib\site-packages\jittor_in
it
_.py:383(array) → },]

Reason: [f 0518 10:22:35.648000 36 log.cc:608] Check failed ret(1) == 0(0) Run cmd failed: “D:\JITTOR_HOME.cache\jittor\jtcuda\cuda11.2_cudnn8_win\bin\nvcc.exe” “D:\JITTOR_HOME.cache\jittor\jt1.3.7\cl\py3.9.13\Windows-10-10.x0c\11thGenInte
lRCx42\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 -Xcompiler -EHa -Xcomp
iler -MD -Xcompiler -utf-8 -I"D:\JITTOR_HOME.cache\jittor\msvc\VC\include" -I"D:\JITTOR_HOME.cache\jittor\msvc\win10_kits\include\ucrt" -I"D:\JITTOR_HOME.cache\jittor\msvc\win10_kits\include\shared" -I"D:\JITTOR_HOME.cache\jittor\msvc
win10_kits\include\um" -DNOMINMAX -L"D:\JITTOR_HOME.cache\jittor\msvc\VC\lib" -L"D:\JITTOR_HOME.cache\jittor\msvc\win10_kits\lib\um\x64" -L"D:\JITTOR_HOME.cache\jittor\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"D:\JITTOR_HOME.cache\jittor\jtcuda\cuda11.2_cudnn8_win\include" -I"d:\program files\python39\python39\lib\site-packages\jittor\extern\cuda
inc" -lcudart -L"D:\JITTOR_HOME.cache\jittor\jtcuda\cuda11.2_cudnn8_win\lib\x64" -L"D:\JITTOR_HOME.cache\jittor\jtcuda\cuda11.2_cudnn8_win\bin" -I"D:\JITTOR_HOME.cache\jittor\jt1.3.7\cl\py3.9.13\Windows-10-10.x0c\11thGenIntelRCx42\defau
lt\cu11.2.67" -L"D:\JITTOR_HOME.cache\jittor\jt1.3.7\cl\py3.9.13\Windows-10-10.x0c\11thGenIntelRCx42\default\cu11.2.67" -L"D:\JITTOR_HOME.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=“D:\JITTOR_HOME.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 “D:\JITTOR_HOME.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_81afcaae637f91
42_op.dll” -Xlinker -EXPORT:“?jit_run@FusedOp@jittor@@QEAAXXZ

编译这个文件的时候,出了问题,可能cuda版本不对?我以前手动装了cuda的,也能用。估计这次 jittor又帮我装了一次,不知道装的版本是否对上了?