Skip to content

Commit

Permalink
Merge pull request #1197 from sony/feature/20230522-add-pillow-limita…
Browse files Browse the repository at this point in the history
…tion

add pillow limitation for nnabla dependency
  • Loading branch information
YukioOobuchi authored Jun 6, 2023
2 parents 1dfa700 + 9a393e0 commit 8d08f33
Show file tree
Hide file tree
Showing 11 changed files with 735 additions and 419 deletions.
2 changes: 1 addition & 1 deletion python/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@
'six',
'tqdm',
'imageio',
'pillow',
'pillow>=9.1.0',
'ply'
]

Expand Down
54 changes: 52 additions & 2 deletions tutorial/by_examples.ipynb
Original file line number Diff line number Diff line change
@@ -1,27 +1,31 @@
{
"cells": [
{
"attachments": {},
"cell_type": "markdown",
"metadata": {},
"source": [
"# NNabla by Examples"
]
},
{
"attachments": {},
"cell_type": "markdown",
"metadata": {},
"source": [
"This tutorial demonstrates how you can write a script to train a neural network by using a simple hand digits classification task."
]
},
{
"attachments": {},
"cell_type": "markdown",
"metadata": {},
"source": [
"Note: This tutorial notebook requires [scikit-learn](http://scikit-learn.org) and [matplotlib](https://matplotlib.org/) installed in your Python environment."
]
},
{
"attachments": {},
"cell_type": "markdown",
"metadata": {},
"source": [
Expand All @@ -36,8 +40,19 @@
},
"outputs": [],
"source": [
"# May show warnings for newly imported packages if run in Colab default python environment.\n",
"# Please click the `RESTART RUNTIME` to run the following script correctly.\n",
"# The error message of conflicts is acceptable.\n",
"!pip install nnabla-ext-cuda116\n",
"!git clone https://github.com/sony/nnabla.git\n",
"!git clone https://github.com/sony/nnabla.git"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"%cd nnabla/tutorial"
]
},
Expand All @@ -64,13 +79,15 @@
]
},
{
"attachments": {},
"cell_type": "markdown",
"metadata": {},
"source": [
"The `tiny_digits` module is located under this folder. It provides some utilities for loading a handwritten-digit classification dataset (MNIST) available in scikit-learn."
]
},
{
"attachments": {},
"cell_type": "markdown",
"metadata": {},
"source": [
Expand All @@ -82,6 +99,7 @@
]
},
{
"attachments": {},
"cell_type": "markdown",
"metadata": {},
"source": [
Expand All @@ -100,6 +118,7 @@
]
},
{
"attachments": {},
"cell_type": "markdown",
"metadata": {},
"source": [
Expand All @@ -116,6 +135,7 @@
]
},
{
"attachments": {},
"cell_type": "markdown",
"metadata": {},
"source": [
Expand All @@ -135,6 +155,7 @@
]
},
{
"attachments": {},
"cell_type": "markdown",
"metadata": {},
"source": [
Expand All @@ -158,6 +179,7 @@
]
},
{
"attachments": {},
"cell_type": "markdown",
"metadata": {},
"source": [
Expand All @@ -178,6 +200,7 @@
]
},
{
"attachments": {},
"cell_type": "markdown",
"metadata": {},
"source": [
Expand All @@ -198,6 +221,7 @@
]
},
{
"attachments": {},
"cell_type": "markdown",
"metadata": {},
"source": [
Expand Down Expand Up @@ -225,13 +249,15 @@
]
},
{
"attachments": {},
"cell_type": "markdown",
"metadata": {},
"source": [
"The output doesn't make sense since the network is just randomly initialized."
]
},
{
"attachments": {},
"cell_type": "markdown",
"metadata": {},
"source": [
Expand All @@ -250,6 +276,7 @@
]
},
{
"attachments": {},
"cell_type": "markdown",
"metadata": {},
"source": [
Expand All @@ -269,6 +296,7 @@
]
},
{
"attachments": {},
"cell_type": "markdown",
"metadata": {},
"source": [
Expand All @@ -289,13 +317,15 @@
]
},
{
"attachments": {},
"cell_type": "markdown",
"metadata": {},
"source": [
"Gradient is stored in grad field of `Variable`. `.g` accessor can be used to access grad data in `numpy.ndarray` format."
]
},
{
"attachments": {},
"cell_type": "markdown",
"metadata": {},
"source": [
Expand All @@ -319,6 +349,7 @@
]
},
{
"attachments": {},
"cell_type": "markdown",
"metadata": {},
"source": [
Expand Down Expand Up @@ -348,6 +379,7 @@
]
},
{
"attachments": {},
"cell_type": "markdown",
"metadata": {},
"source": [
Expand All @@ -372,6 +404,7 @@
]
},
{
"attachments": {},
"cell_type": "markdown",
"metadata": {},
"source": [
Expand All @@ -394,6 +427,7 @@
]
},
{
"attachments": {},
"cell_type": "markdown",
"metadata": {},
"source": [
Expand All @@ -402,6 +436,7 @@
]
},
{
"attachments": {},
"cell_type": "markdown",
"metadata": {},
"source": [
Expand All @@ -427,6 +462,7 @@
]
},
{
"attachments": {},
"cell_type": "markdown",
"metadata": {},
"source": [
Expand All @@ -452,6 +488,7 @@
]
},
{
"attachments": {},
"cell_type": "markdown",
"metadata": {},
"source": [
Expand All @@ -471,13 +508,15 @@
]
},
{
"attachments": {},
"cell_type": "markdown",
"metadata": {},
"source": [
"## Multi-Layer Perceptron (MLP)"
]
},
{
"attachments": {},
"cell_type": "markdown",
"metadata": {},
"source": [
Expand All @@ -498,6 +537,7 @@
]
},
{
"attachments": {},
"cell_type": "markdown",
"metadata": {},
"source": [
Expand Down Expand Up @@ -607,6 +647,7 @@
]
},
{
"attachments": {},
"cell_type": "markdown",
"metadata": {},
"source": [
Expand Down Expand Up @@ -651,6 +692,7 @@
]
},
{
"attachments": {},
"cell_type": "markdown",
"metadata": {},
"source": [
Expand Down Expand Up @@ -701,6 +743,7 @@
]
},
{
"attachments": {},
"cell_type": "markdown",
"metadata": {},
"source": [
Expand All @@ -718,6 +761,7 @@
]
},
{
"attachments": {},
"cell_type": "markdown",
"metadata": {},
"source": [
Expand Down Expand Up @@ -764,6 +808,7 @@
]
},
{
"attachments": {},
"cell_type": "markdown",
"metadata": {},
"source": [
Expand Down Expand Up @@ -851,6 +896,7 @@
]
},
{
"attachments": {},
"cell_type": "markdown",
"metadata": {},
"source": [
Expand All @@ -872,6 +918,7 @@
]
},
{
"attachments": {},
"cell_type": "markdown",
"metadata": {},
"source": [
Expand Down Expand Up @@ -912,6 +959,7 @@
]
},
{
"attachments": {},
"cell_type": "markdown",
"metadata": {},
"source": [
Expand Down Expand Up @@ -970,6 +1018,7 @@
]
},
{
"attachments": {},
"cell_type": "markdown",
"metadata": {},
"source": [
Expand Down Expand Up @@ -1028,6 +1077,7 @@
]
},
{
"attachments": {},
"cell_type": "markdown",
"metadata": {},
"source": [
Expand All @@ -1052,12 +1102,12 @@
}
],
"metadata": {
"accelerator": "GPU",
"kernelspec": {
"display_name": "Python 3",
"language": "python",
"name": "python3"
},
"accelerator": "GPU",
"language_info": {
"codemirror_mode": {
"name": "ipython",
Expand Down
Loading

0 comments on commit 8d08f33

Please sign in to comment.