遇到报错:TypeError: conv2d() received an invalid combination of arguments - got (numpy.ndarray, Parameter, Parameter, tuple, tuple, tuple, int), but expected one of:
* (Tensor input, Tensor weight, Tensor bias, tuple of ints stride, tuple of ints padding, tuple of ints dilation, int groups)
didn't match because some of the arguments have invalid types: (!numpy.ndarray!, !Parameter!, !Parameter!, !tuple!, !tuple!, !tuple!, int)
* (Tensor input, Tensor weight, Tensor bias, tuple of ints stride, str padding, tuple of ints dilation, int groups)
didn't match because some of the arguments have invalid types: (!numpy.ndarray!, !Parameter!, !Parameter!, !tuple!, !tuple!, !tuple!, int)
一定是你的输入网络的东西是numpy而不是tensor,这时 需要把numpy转换成tensor再输入网络即可。
文章讲述了在使用TensorFlow时遇到的TypeError,原因在于输入网络时使用了numpy数组而非Tensor。解决方案是将numpy数组转换为Tensor后再进行网络操作。
3399

被折叠的 条评论
为什么被折叠?



