KittenCN / predict_Lottery_ticket_pytorch

pytorch下基于transformer / LSTM模型的彩票预测
https://www.coderfan.com
65 stars 29 forks source link

binary_encoded_array函数报错 #11

Open wohuainiande opened 4 months ago

wohuainiande commented 4 months ago

大佬 问一下这个函数报错 是啥情况 跟设备有关系吗 还是不兼容之类的 该如何修改啊 binary_encoded_array[i, number - 1] = 1.0 # Adjust index for 0-based indexing IndexError: tensors used as indices must be long, int, byte or bool tensors

989888 commented 1 month ago

你好,我也是出现这个问题,请问您解决了这个问题了么,在等待

YunKunZhang commented 2 weeks ago

number是tensor类型的变量,转成int类型就可以了。 number = int(input_array[i, j].item()) @wohuainiande @989888