RuntimeError: cuda runtime error (10) : invalid device ordinal

This is caused by the unmatching of gpu device number when loading a saved model.

torch.load('my_file.pt', map_location=lambda storage, loc: storage)

ref:

http://blog.csdn.net/shincling/article/details/78919282

原文地址:https://www.cnblogs.com/beatets/p/8531914.html