'Importing Adam and ImageDataGenerator on google colab failed

I'm implementing a UNet neural network but I'm having some issues while importing libraries. I found a solution for a couple of them, but I still have a problem with these two imports:

from tensorflow.keras.optimizers import Adam
#Import "tensorflow.keras.optimizers" could not be resolved(reportMissingImports)

from tensorflow.keras.preprocessing.image import ImageDataGenerator
#Import "tensorflow.keras.preprocessing.image" could not be resolved(reportMissingImports)

I've already imported:

import tensorflow as tf
from tensorflow import keras
from keras import layers
import tensorflow_datasets as tfds
import matplotlib.pyplot as plt
import numpy as np

Any idea? I've tried to change but it still raises an error.



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source