のねのBlog

パソコンの問題や、ソフトウェアの開発で起きた問題など書いていきます。よろしくお願いします^^。

AttributeError: module 'torch.nn' has no attribute 'functional'

                                                                                                                                                    • -

AttributeError Traceback (most recent call last)
in ()

        • > 1 from fastai.transforms import *

2 from fastai.conv_learner import *
3 from fastai.model import *
4 from fastai.dataset import *
5 from fastai.sgdr import *

/content/fastai-master/courses/dl1/fastai/transforms.py in ()
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):

/content/fastai-master/courses/dl1/fastai/layer_optimizer.py in ()
1 from .imports import *

        • > 2 from .torch_imports import *

3 from .core import *
4
5 def opt_params(parm, lr, wd):

/content/fastai-master/courses/dl1/fastai/torch_imports.py in ()
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/torchvision/__init__.py in ()

        • > 1 from torchvision import models

2 from torchvision import datasets
3 from torchvision import transforms
4 from torchvision import utils
5

/usr/local/lib/python3.6/dist-packages/torchvision/models/__init__.py in ()
3 from .vgg import *
4 from .squeezenet import *

        • > 5 from .inception import *

6 from .densenet import *

/usr/local/lib/python3.6/dist-packages/torchvision/models/inception.py in ()
1 import torch
2 import torch.nn as nn

        • > 3 import torch.nn.functional as F

4 import torch.utils.model_zoo as model_zoo
5

AttributeError: module 'torch.nn' has no attribute 'functional'