google-research / big_transfer

Official repository for the "Big Transfer (BiT): General Visual Representation Learning" paper.
https://arxiv.org/abs/1912.11370
Apache License 2.0
1.5k stars 175 forks source link

module 'torch' has no attribute 'var_mean' #9

Open longmao-yiran opened 4 years ago

longmao-yiran commented 4 years ago

I have got the AttributeError called "module 'torch' has no attribute 'var_mean'" when i run the code I search the Docs in pytorch find var_mean can be used lasters at least 1.2.0 I think you need to change the https://github.com/google-research/big_transfer/blob/6c83d6459e009fa89d84c1e904611e9b162e6eff/bit_pytorch/requirements.txt#L1 to 1.2.0

longmao-yiran commented 4 years ago

It`s alse can change

https://github.com/google-research/big_transfer/blob/6c83d6459e009fa89d84c1e904611e9b162e6eff/bit_pytorch/models.py#L29 to v = torch.var(w, dim=[1, 2, 3], keepdim=True, unbiased=False) m = torch.mean(w, dim=[1, 2, 3], keepdim=True)