ZexinYan / Medical-Report-Generation

A pytorch implementation of On the Automatic Generation of Medical Imaging Reports.
199 stars 65 forks source link

the question of version #6

Open Qiao1995 opened 5 years ago

Qiao1995 commented 5 years ago

what is the version of the python and torch ? I have some bugs when I run the tester.py. for exmple,

Traceback (most recent call last): File "tester.py", line 502, in sampler.generate() File "tester.py", line 144, in generate sampled_ids = self.word_model.sample(topic, start_tokens) File "/home/cheng/perl5/Medical-Report-Generation-master/utils/models.py", line 386, in sample sampled_ids[:, 0] = start_tokens.view(-1, ) File "/usr/local/lib/python3.6/site-packages/torch/tensor.py", line 452, in array return self.numpy().astype(dtype, copy=False) TypeError: can't convert CUDA tensor to numpy. Use Tensor.cpu() to copy the tensor to host memory first.