I want to install Torch (http://torch.ch/docs/getting-started.html#_) on Google Colab. However, to install Torch, we need to run the following command at the final step source ~/.bashrc
To run this command on google colab, the code I use is
%%bash
source ~/.bashrc
When I run those, I get a warning
bash: line 1: /content/.bashrc: No such file or directory
I also use this command to find bashrc
!find / -name '*bashrc'
And here is the output I get
/root/.bashrc
/etc/skel/.bashrc
/etc/bash.bashrc
/usr/share/base-files/dot.bashrc
/usr/share/doc/adduser/examples/adduser.local.conf.examples/skel/dot.bashrc
/usr/share/doc/adduser/examples/adduser.local.conf.examples/bash.bashrc
I try to run the source
command on all of those paths. I also try the same with .profile
. But the Torch still has not been installed.
EDIT: I'm not sure if Torch is installed or not. The specific problem here is that I just get an error
command not found
whenever I run th
or luarocks
in case this question is still actual, type these commands in Google Colab:`
from os import path
from wheel.pep425tags import get_abbr_impl, get_impl_ver, get_abi_tag
platform = '{}{}-{}'.format(get_abbr_impl(), get_impl_ver(), get_abi_tag())
accelerator = 'cu80' if path.exists('/opt/bin/nvidia-smi') else 'cpu'
!pip install -q http://download.pytorch.org/whl/{accelerator}/torch-0.3.0.post4-{platform}-linux_x86_64.whl torchvision
import torch
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With