fixed a couple of issues that made the notebook not work in colab (#1460)

* fixed a couple of issues that made the notebook not work in colab

i fixed a couple of issues that made the notebook not work in colab 
1. it downloaded incompatible versions of pytorch and cuda + the conda command doesnt do anything in colab since there is no conda in colab idk w y wanna do about that - The commit of 2 days ago only changes the conda command version and not the pip command which is used while isntaling mcvv
2. /demo.png doesnt exist in colab so i added a wget to download some cityscapes photo from the internet and run inference on that photo
3. i think it would be optimal to have 2 notebooks. 1 for running locally when cloning your git branch and one to run in google colab.

* Update demo/MMSegmentation_Tutorial.ipynb

* Update demo/MMSegmentation_Tutorial.ipynb

* Update demo/MMSegmentation_Tutorial.ipynb

* Update demo/MMSegmentation_Tutorial.ipynb

* Update demo/MMSegmentation_Tutorial.ipynb

Co-authored-by: Miao Zheng <76149310+MeowZheng@users.noreply.github.com>
This commit is contained in:
jere357 2022-04-22 04:10:02 +02:00 committed by GitHub
parent 10c0c24638
commit aa68bf15b7

View File

@ -69,7 +69,7 @@
"# Install PyTorch\n", "# Install PyTorch\n",
"!conda install pytorch=1.10.0 torchvision cudatoolkit=11.1 -c pytorch\n", "!conda install pytorch=1.10.0 torchvision cudatoolkit=11.1 -c pytorch\n",
"# Install MMCV\n", "# Install MMCV\n",
"!pip install mmcv-full -f https://download.openmmlab.com/mmcv/dist/cu101/torch1.6/index.html" "!pip install mmcv-full -f https://download.openmmlab.com/mmcv/dist/cu111/torch1.10/index.html"
] ]
}, },
{ {
@ -156,8 +156,8 @@
}, },
"outputs": [], "outputs": [],
"source": [ "source": [
"config_file = '../configs/pspnet/pspnet_r50-d8_512x1024_40k_cityscapes.py'\n", "config_file = 'configs/pspnet/pspnet_r50-d8_512x1024_40k_cityscapes.py'\n",
"checkpoint_file = '../checkpoints/pspnet_r50-d8_512x1024_40k_cityscapes_20200605_003338-2966598c.pth'" "checkpoint_file = 'checkpoints/pspnet_r50-d8_512x1024_40k_cityscapes_20200605_003338-2966598c.pth'"
] ]
}, },
{ {
@ -185,7 +185,7 @@
"outputs": [], "outputs": [],
"source": [ "source": [
"# test a single image\n", "# test a single image\n",
"img = './demo.png'\n", "img = 'demo/demo.png'\n",
"result = inference_segmentor(model, img)" "result = inference_segmentor(model, img)"
] ]
}, },