TADT-python icon indicating copy to clipboard operation
TADT-python copied to clipboard

Error with narrow() function

Open Abdelpakey opened this issue 6 years ago • 1 comments

Thanks for sharing this code When I run this code it gives this error c_output = c_output.narrow(i, p[0], c_output.size(i) - p[0])

TypeError: narrow(): argument 'start' (position 2) must be int, not numpy.int64

Abdelpakey avatar Jul 10 '19 15:07 Abdelpakey

Thanks for sharing this code When I run this code it gives this error c_output = c_output.narrow(i, p[0], c_output.size(i) - p[0])

TypeError: narrow(): argument 'start' (position 2) must be int, not numpy.int64

it may caused by pytorch version.if your pytorch is 0.4.1 not 1.1.0, you can change the pad type to solve it,like : output = F.pad(response, (int(padding[1]), int(padding[1]), int(padding[0]), [int(padding[0])))

fangInFBI avatar Apr 14 '20 14:04 fangInFBI