I remember this issue occurred if a wrong CUDA version was installed and in the first run it’s recompiling pytorch for your GPU.
Unfortunately there is no CUDA9 for pytorch 0.2.0.
However, could you print torch.version.cuda after your first cuda run?
@rasbt ideas sound good to debug your issue!