BoyuanJiang / matching-networks-pytorch

Matching Networks for one shot learning
228 stars 67 forks source link

Pytorch version requirement 0.3.1 #6

Closed CookieLau closed 5 years ago

CookieLau commented 5 years ago

Since the update of Pytorch has changed its API for some functions, thus the version >= 0.4.0 is not compatible with this code. You need to create a new conda environment with python3 and Pytorch 0.3.1 to run.

Otherwise, you will find it stack with problem:"TypeError iteration over a 0-d tensor" 2019-07-28-15-41-54

That's all.

SaoYear commented 1 year ago

Thanks!

You could also modify in the file matching_networks.py: replace all .data[0] to .data.item()

And comments on

if self.fce:
    outputs = self.lstm(output)

PS: The outputs is not used in the code anyway right?