Skip to content

Instantly share code, notes, and snippets.

@denis-trofimov
Last active August 31, 2018 19:34
Show Gist options
  • Save denis-trofimov/54eb02b68fb01fa864609b86e967bf6f to your computer and use it in GitHub Desktop.
Save denis-trofimov/54eb02b68fb01fa864609b86e967bf6f to your computer and use it in GitHub Desktop.
Fast.ai install script.ipynb
Display the source blob
Display the rendered blob
Raw
{
"nbformat": 4,
"nbformat_minor": 0,
"metadata": {
"colab": {
"name": "Fast.ai install script.ipynb",
"version": "0.3.2",
"provenance": [],
"private_outputs": true,
"include_colab_link": true
},
"kernelspec": {
"name": "python3",
"display_name": "Python 3"
},
"accelerator": "GPU"
},
"cells": [
{
"cell_type": "markdown",
"metadata": {
"id": "view-in-github",
"colab_type": "text"
},
"source": [
"[View in Colaboratory](https://colab.research.google.com/gist/denis-trofimov/54eb02b68fb01fa864609b86e967bf6f/fast-ai-install-script.ipynb)"
]
},
{
"metadata": {
"id": "3XuvfZyTPat-",
"colab_type": "code",
"colab": {}
},
"cell_type": "code",
"source": [
"!pip install fastai"
],
"execution_count": 0,
"outputs": []
},
{
"metadata": {
"id": "w7X_v6zaMAT8",
"colab_type": "code",
"colab": {}
},
"cell_type": "code",
"source": [
"from os import path\n",
"from wheel.pep425tags import get_abbr_impl, get_impl_ver, get_abi_tag\n",
"platform = '{}{}-{}'.format(get_abbr_impl(), get_impl_ver(), get_abi_tag())\n",
"accelerator = 'cu80' if path.exists('/opt/bin/nvidia-smi') else 'cpu'\n",
"print(accelerator)\n",
"!pip install -q http://download.pytorch.org/whl/{accelerator}/torch-0.3.1-{platform}-linux_x86_64.whl torchvision\n",
"import torch"
],
"execution_count": 0,
"outputs": []
},
{
"metadata": {
"id": "-Y02jlSsQTsx",
"colab_type": "code",
"colab": {}
},
"cell_type": "code",
"source": [
"!pip install Pillow==4.0.0 image"
],
"execution_count": 0,
"outputs": []
},
{
"metadata": {
"id": "UukcAWHfQNGO",
"colab_type": "code",
"colab": {}
},
"cell_type": "code",
"source": [
"!apt-get -qq install -y libsm6 libxext6 && pip install -q -U opencv-python\n",
"import cv2"
],
"execution_count": 0,
"outputs": []
}
]
}
@denis-trofimov
Copy link
Author

Bumped torch to 0.3.1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment