DeLightCMU / RSC

This is the official implementation of Self-Challenging Improves Cross-Domain Generalization, ECCV2020
BSD 2-Clause "Simplified" License
160 stars 18 forks source link

torch.gt return BoolType value from 1.2.0 #1

Closed JasonDoingGreat closed 3 years ago

JasonDoingGreat commented 4 years ago

Since Pytorch 1.2.0, torch.gt returns BoolType instead of ByteType which will cause error on https://github.com/DeLightCMU/RSC/blob/2622a6c1cefc4b6c7c39bb95c457a2a36d27dae9/models/resnet.py#L170

Pls kindly take a look and add some requirements for pytorch version

Justinhzy commented 4 years ago

Hi, sorry for the late reply. I use pytorch 1.1.0 or 1.0.1. I will fix the bug for higher pytorch version. Thanks for your advice.

talhazaidi13 commented 3 years ago

Hi. Did you update the code for higher versions of PyTorch to fix the same bug? I am getting the same problem in runtime.

JasonDoingGreat commented 3 years ago

Hi. Did you update the code for higher versions of PyTorch to fix the same bug? I am getting the same problem in runtime.

A simple walk around is to add .long() at the end

https://github.com/DeLightCMU/RSC/blob/c46568709965ae5a1ea92e95ab6ae27cc190eb0d/models/resnet.py#L136

Justinhzy commented 3 years ago

@JasonDoingGreat Thanks. I will fix it.

talhazaidi13 commented 3 years ago

it works now, Thanks.