代码之家  ›  专栏  ›  技术社区  ›  Soumyadip Ghosh

无法将参数2从cdata<struct thlongtensor*>转换为cdata<struct thcudalongtensor*>

  •  0
  • Soumyadip Ghosh  · 技术社区  · 6 年前

    我在尝试用cuda运行torch lua代码时得到以下错误跟踪。到modified lookuptablewithnulls.lua的链接如下。 LookupTableWithNulls.lua

    /home/s/sghosh/torch/install/bin/lua: unable to convert argument 2 from 
    cdata<struct THLongTensor*> to cdata<struct THCudaLongTensor*>
    stack traceback:
    [C]: in function 'v'
    /home/s/sghosh/torch/install/share/lua/5.2/nn/THNN.lua:110: in function 'LookupTable_accGradParameters'
    .../neural-checklist-master/layers/LookupTableWithNulls.lua:98: in function 'accGradParameters'
    ...s/sghosh/torch/install/share/lua/5.2/nngraph/gmodule.lua:479: in function 'neteval'
    ...s/sghosh/torch/install/share/lua/5.2/nngraph/gmodule.lua:490: in function 'accGradParameters'
    /home/s/sghosh/torch/install/share/lua/5.2/nn/Module.lua:32: in function 'backward'
    ./neural_checklist_model.lua:1553: in function 'backward_pass'
    train.lua:126: in function 'train_model'
    train.lua:199: in function 'main'
    train.lua:203: in main chunk
    [C]: in function 'dofile'
    ...hosh/torch/install/lib/luarocks/rocks/trepl/scm-1/bin/th:150: in main chunk
    [C]: in ?
    
    0 回复  |  直到 6 年前