ModuleNotFoundError: No module named 'networks.model_unet'

Hello Everyone,

Can anyone please help me understand the reason why I fail to execute the following line in jupyter notebook but when try the same in spyder it works ??

from networks.model_unet import Unet
from utils.CustomDataset import Construct

import os
import time
import random
import torch
import torchvision
import torch.nn as nn
import torch.backends.cudnn as cudnn
import torch.nn.functional as F
import numpy as np
import scipy.stats as st

#from skimage.measure import compare_ssim, compare_psnr

ModuleNotFoundError Traceback (most recent call last)
----> 1 from networks.model_unet import Unet
3 from utils.CustomDataset import Construct
5 import os

ModuleNotFoundError: No module named ‘networks.model_unet’

I shall be obliged for the help . Thank you.

The error suggests that no module was found in your networks directory.
You can try to check two things:

  1. Do you have a networks directory with an
  2. At what path does your jupyter notebook starts.

Hello CedricLy,

Thank you for the suggestion.