0
import torch
from torch import nn
from torch.nn import functional as F
from .utils import (
    round_filters,
    round_repeats,
    drop_connect,
    get_same_padding_conv2d,
    get_model_params,
    efficientnet_params,
    load_pretrained_weights,
    Swish,
    MemoryEfficientSwish,
    calculate_output_image_size
)

I tried a lot but I could'nt find the solution to fix this error

  • Welcome to SO! Please go through [How to ask a good question](https://stackoverflow.com/help/how-to-ask) and [How to create a minimal, reproducible example](https://stackoverflow.com/help/minimal-reproducible-example). Then, please update your question which will help us understand the issue in a better way - link all the relevant questions you have searched on SO to solve your problem and share the full error traceback as text in a code block in the question. :) – medium-dimensional Dec 25 '22 at 05:55

1 Answers1

0
from .utils import round_filters

It gives error: relative import with no known parent package. See discussion for this in stackoverflow thread.

You need to install EfficientNet-PyTorch package. About this package

!pip install EfficientNet-PyTorch

And add parent package as from efficientnet_pytorch.utils import round_filters So your code should be

import torch
from torch import nn
from torch.nn import functional as F
from efficientnet_pytorch.utils import (
    round_filters,
    round_repeats,
    drop_connect,
    get_same_padding_conv2d,
    get_model_params,
    efficientnet_params,
    load_pretrained_weights,
    Swish,
    MemoryEfficientSwish,
    calculate_output_image_size
)