I’m trying to run lesson1.ipynb in Google Colab.
I’ve read through this thread and also this gist.
What is the cut-and-paste code to place in a cell at the top of lesson1.ipynb
in order to get it to work?
If I use:
pip install fastai
I get the error:
ModuleNotFoundError: No module named 'fastai.transforms'
Trying with:
pip install fastai==0.7
I get:
mizani 0.5.3 has requirement pandas>=0.23.4, but you'll have pandas 0.22.0 which is incompatible.
plotnine 0.5.1 has requirement matplotlib>=3.0.0, but you'll have matplotlib 2.1.2 which is incompatible.
plotnine 0.5.1 has requirement pandas>=0.23.4, but you'll have pandas 0.22.0 which is incompatible.
torchvision 0.2.1 has requirement pillow>=4.1.1, but you'll have pillow 4.0.0 which is incompatible.
and then later:
---------------------------------------------------------------------------
AttributeError Traceback (most recent call last)
<ipython-input-5-8c2b6852f90b> in <module>()
1
----> 2 from fastai.transforms import *
3 from fastai.conv_learner import *
4 from fastai.model import *
5 from fastai.dataset import *
/usr/local/lib/python3.6/dist-packages/fastai/transforms.py in <module>()
1 from .imports import *
----> 2 from .layer_optimizer import *
3 from enum import IntEnum
4
5 def scale_min(im, targ, interpolation=cv2.INTER_AREA):
/usr/local/lib/python3.6/dist-packages/fastai/layer_optimizer.py in <module>()
1 from .imports import *
----> 2 from .torch_imports import *
3 from .core import *
4
5 def opt_params(parm, lr, wd):
/usr/local/lib/python3.6/dist-packages/fastai/torch_imports.py in <module>()
1 import os
----> 2 import torch, torchvision, torchtext
3 from torch import nn, cuda, backends, FloatTensor, LongTensor, optim
4 import torch.nn.functional as F
5 from torch.autograd import Variable
/usr/local/lib/python3.6/dist-packages/torchtext/__init__.py in <module>()
----> 1 from . import data
2 from . import datasets
3 from . import utils
4 from . import vocab
5
/usr/local/lib/python3.6/dist-packages/torchtext/data/__init__.py in <module>()
2 from .dataset import Dataset, TabularDataset
3 from .example import Example
----> 4 from .field import RawField, Field, ReversibleField, SubwordField, NestedField, LabelField
5 from .iterator import (batch, BucketIterator, Iterator, BPTTIterator,
6 pool)
/usr/local/lib/python3.6/dist-packages/torchtext/data/field.py in <module>()
59
60
---> 61 class Field(RawField):
62 """Defines a datatype together with instructions for converting to Tensor.
63
/usr/local/lib/python3.6/dist-packages/torchtext/data/field.py in Field()
116 # numeric type.
117 dtypes = {
--> 118 torch.float32: float,
119 torch.float: float,
120 torch.float64: float,
AttributeError: module 'torch' has no attribute 'float32'
Pardon me if this has already been asked and answered - I did search and still came up empty handed.