How to import 'get_window' in python correctly?

202 Views Asked by At

I am trying to run a code in jupyter notbook, but I am having a problem with these lines:

from skimage.transform import resize from skimage.morphology import label

Those two lines are causing the problem, and this is the error message :

ImportError: cannot import name 'get_window'

This is the import code I used. please help me because I have tried everything I know.


import os
import random
import pandas as pd
import numpy as np
import seaborn as sns
import matplotlib.pyplot as plt
plt.style.use("ggplot")
%matplotlib inline

import cv2
from tqdm import tqdm_notebook, tnrange
from glob import glob
from itertools import chain
from skimage.io import imread, imshow, concatenate_images
from skimage.transform import resize
from skimage.morphology import label
from sklearn.model_selection import train_test_split

import tensorflow as tf
from skimage.color import rgb2gray
from tensorflow.keras import Input
from tensorflow.keras.models import Model, load_model, save_model
from tensorflow.keras.layers import Input, Activation, BatchNormalization, Dropout, Lambda, Conv2D, Conv2DTranspose, MaxPooling2D, concatenate
from tensorflow.keras.optimizers import Adam
from tensorflow.keras.callbacks import EarlyStopping, ModelCheckpoint, ReduceLROnPlateau

from tensorflow.keras import backend as K
from tensorflow.keras.preprocessing.image import ImageDataGenerator
from tensorflow.keras.callbacks import EarlyStopping, ModelCheckpoint
1

There are 1 best solutions below

0
On

A quick search of the scikit-image codebase shows that get_window is a function provided by scipy.signal. My guess is that you need to install SciPy or update your SciPy version.