title: Imported necessary packages, but I'm still getting ImportError: cannot import name 'Adam' from 'keras.optimizers'
body: <p>I have been trying to run a machine learning training program on an HPC cluster using MobaXterm for a while now and have been getting</p>
  <pre><code>ImportError: cannot import name 'Adam' from 'keras.optimizers'
  </code></pre>
  <p>and similar errors when I run the main file which should train a model and then output a file of trained weights. I am making sure to import the necessary package relevant to the error through the line: &quot;from keras.optimizers import Adam&quot;, so it's a mystery as to why this won't go away.</p>
  <p>Someone in another thread suggested tensorflow.keras.optimizers instead of keras.optimizers, but that just gives me the alternative error:</p>
  <pre><code>ValueError: Could not interpret optimizer identifier: &lt;tensorflow.python.keras.optimizer_v2.adam.Adam object at 0x2aab0e2dd828&gt;
  </code></pre>
  <p>Interestingly, the program, which is almost unedited from a github download, runs perfectly when running it on my computer locally, and also works great on Google Colab. As soon as I began sending it to the cluster the issues appear. Wonder if anyone has experience with this kind of thing and knows what I should be paying attention to. Thanks in advance!</p>
  <p>Edit: I realized it may be helpful to show all the imports i'm doing at the beginning of the file, they are here:</p>
  <pre><code>from __future__ import print_function
  import numpy as np 
  import os
  import skimage.io as io
  import skimage.transform as trans
  import numpy as np
  from keras.models import *
  from keras.layers import *
  from keras.optimizers import *  #I have tried commenting out this line but still face the same error
  from keras.callbacks import ModelCheckpoint, LearningRateScheduler
  from keras import backend as keras
  from keras.preprocessing.image import ImageDataGenerator
  import glob
  
  from keras.optimizers import Adam
  </code></pre>