There might be another PyTorch installation.
As you can see, you’ve uninstalled torch-0.4.0, then reinstalled it, but version 0.3.0.post4 is loaded.
Try to run the uninstall command several times until an error message occurs saying there are no torch installations.
Otherwise, could you try to create a new “clean” colab notebook?
I had similar issues with some package installations.
In my case, I uninstalled previous pytorch(torch) following your guide. But, I got “0.3.0.post4” by command “print(torch.version)” even can’t find torch in “pip list”! There is some problem about caching python module in using notebook. Best solution is make new notebook and install lasted pytorch version. Another solution is deleting cache. Click “Restart Runtime” below “Tool” in colab menu. Then you can see message “ModuleNotFoundError: No module named ‘torch’”.
I’ve been running same code today, but notebook crashes and restarts, so I can’t get stack trace after. I’ll update later if I get it running.
It dies on torch import line
I tried to run the script in a new notebook and got the same “error”.
Apparently it’s just a warning, as after a few seconds, PyTorch is successfully installed.
Could you try it again and wait a few more seconds?