Created
June 6, 2021 00:59
-
-
Save duskvirkus/ffbe11d506edf57a50eb7080676ef1d3 to your computer and use it in GitHub Desktop.
os-getcwd-bug.ipynb
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"nbformat": 4, | |
"nbformat_minor": 0, | |
"metadata": { | |
"colab": { | |
"name": "os-getcwd-bug.ipynb", | |
"provenance": [], | |
"collapsed_sections": [], | |
"authorship_tag": "ABX9TyOEWqqeSRTqJ4/147Gsc9Xt", | |
"include_colab_link": true | |
}, | |
"kernelspec": { | |
"name": "python3", | |
"display_name": "Python 3" | |
}, | |
"language_info": { | |
"name": "python" | |
} | |
}, | |
"cells": [ | |
{ | |
"cell_type": "markdown", | |
"metadata": { | |
"id": "view-in-github", | |
"colab_type": "text" | |
}, | |
"source": [ | |
"<a href=\"https://colab.research.google.com/gist/duskvirkus/ffbe11d506edf57a50eb7080676ef1d3/os-getcwd-bug.ipynb\" target=\"_parent\"><img src=\"https://colab.research.google.com/assets/colab-badge.svg\" alt=\"Open In Colab\"/></a>" | |
] | |
}, | |
{ | |
"cell_type": "markdown", | |
"metadata": { | |
"id": "XdMmZ9UTyglU" | |
}, | |
"source": [ | |
"To reproduce bug:\n", | |
"\n", | |
"1. Run all 4 cells and note the output of cell 3.\n", | |
"2. Terminate the runtime in Manage Sessions.\n", | |
"3. Run first 3 cells and see the output of cell 3." | |
] | |
}, | |
{ | |
"cell_type": "code", | |
"metadata": { | |
"id": "zFqcFcIIwvMl" | |
}, | |
"source": [ | |
"from google.colab import drive\n", | |
"drive.mount('/content/drive')" | |
], | |
"execution_count": null, | |
"outputs": [] | |
}, | |
{ | |
"cell_type": "code", | |
"metadata": { | |
"id": "mwSccXJBxj1j" | |
}, | |
"source": [ | |
"import os\n", | |
"if os.path.isdir(\"/content/drive/MyDrive/colab-sg2-guided-feature\"):\n", | |
" %cd \"/content/drive/MyDrive/colab-sg2-guided-feature/stylegan2-ada-pytorch\"\n", | |
"else:\n", | |
" if os.path.isdir(\"/content/drive/\"):\n", | |
" %cd \"/content/drive/MyDrive/\"\n", | |
" !mkdir colab-sg2-guided-feature\n", | |
" %cd colab-sg2-guided-feature\n", | |
" !git clone --branch guided-feature https://github.com/duskvirkus/stylegan2-ada-pytorch\n", | |
" %cd stylegan2-ada-pytorch\n", | |
" else:\n", | |
" !git clone --branch guided-feature https://github.com/duskvirkus/stylegan2-ada-pytorch\n", | |
" %cd stylegan2-ada-pytorch\n", | |
" !mkdir working\n", | |
" !mkdir vectors\n", | |
" !mkdir output\n", | |
" !mkdir pretrained\n", | |
" %cd pretrained\n", | |
" !gdown --id 1-OmjJCOBGLBLtOplIxPvVmyjAhotzSbM\n", | |
" %cd ..\n", | |
"\n", | |
"!pip install ninja opensimplex" | |
], | |
"execution_count": null, | |
"outputs": [] | |
}, | |
{ | |
"cell_type": "code", | |
"metadata": { | |
"id": "UYgrbc8609LI" | |
}, | |
"source": [ | |
"print(os.getcwd())" | |
], | |
"execution_count": null, | |
"outputs": [] | |
}, | |
{ | |
"cell_type": "code", | |
"metadata": { | |
"id": "wKMvLMWEx0XY" | |
}, | |
"source": [ | |
"%cd /content\n", | |
"!rm -rf /content/drive/MyDrive/colab-sg2-guided-feature" | |
], | |
"execution_count": null, | |
"outputs": [] | |
} | |
] | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment