PyTorch 0.3.1 Code to Latest Version of Ubuntu and GPU?

Hello PyTorch Community,

I am currently working on a research project that involves an old model developed using PyTorch 0.3.1. Given the advancements in hardware and software, I need to update this model to run on my modern computing environment. Below are the details of my current setup and the libraries involved:

Current Hardware and Software Setup

  • Operating System: Ubuntu 20.04
  • GPU: 2x NVIDIA 3090 GPUs
  • CUDA Version: 12.3 (Base installation)

Original Model’s Environment

  • six
  • tqdm
  • torch==0.3.1
  • torchtext==0.2.3
  • future
  • pyxdameraulevenshtein


The code was initially designed for an environment with much older hardware and software versions. I am facing compatibility issues, particularly with the CUDA and PyTorch versions. Specifically, PyTorch 0.3.1 does not support CUDA 12.3, and there are substantial API changes between PyTorch 0.3.1 and the current version.


Could anyone provide guidance or best practices on how to effectively update my old PyTorch 0.3.1 code to be compatible with the latest version of PyTorch? I am looking for concrete steps or examples to facilitate this transition.

I would suggest the pragmatic way of executing the code and fixing issues based on warnings and errors. E.g. I would assume Variables were used, which should be removed (you can still fine their usage in current code even though they were deprecated since torch==0.4).