dyhan0920 / PyramidNet-PyTorch

A PyTorch implementation for PyramidNets (Deep Pyramidal Residual Networks, https://arxiv.org/abs/1610.02915)

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Useful trainning tips: small bug for Python >= 3.5

reverseuniverse opened this issue · comments

For Python version >= 3.5, async becomes a keyword in Python. So the target.cuda(async=True) will cause error while running the scripts.

In order to fix this,
change line 276 and 325 in train.py
from

target = target.cuda(async=True)

to

target = target.cuda(non_blocking=True)

Also, remind to suitable code for different Pytorch version in train.py from line 327 to line 338