xlnet-Pytorch icon indicating copy to clipboard operation
xlnet-Pytorch copied to clipboard

TypeError:can't convert np.ndarray of type numpy.bool_

Open menggehe opened this issue 5 years ago • 2 comments

Traceback (most recent call last): File "main.py", line 89, in num_predict=args.num_predict) File "/home/hemengge/xlnet-pytorch/data_utils.py", line 335, in make_permute is_masked = torch.Tensor(feature.pop("is_masked"))

TypeError: can't convert np.ndarray of type numpy.bool_. The only supported types are: double, float, float16, int64, int32, and uint8

menggehe avatar Jul 19 '19 08:07 menggehe

Having the same issue.

LorraineLo4 avatar Jul 21 '19 04:07 LorraineLo4

is_masked = torch.ByteTensor(feature.pop("is_masked").copy().astype(np.uint8)) @menggehe

xingchensong avatar Jul 31 '19 06:07 xingchensong