title: keras and tensorflow(backend error) Tensor conv2d_1_input:0, specified in either feed_devices or fetch_devices was not found in the Graph
body: <p>I was using keras and tensorfoow and i'm completely new to it.
  I had trained my models and when i make to predict it the error is showing.
  This is the code i have used for the image prediction</p>
  
  <pre><code>import numpy as np
  from flask import Flask, request, jsonify, render_template
  import numpy
  from PIL import Image
  import os
  import tensorflow.keras
  from werkzeug.utils import secure_filename
  from keras.models import load_model
  
  app = Flask(__name__)
  
  model = load_model('traffic_classifier.h5')
  model._make_predict_function()
  
  @app.route('/')
  def index():
      # Main page
      return render_template('index.html')
  
  @app.route('/traffic')
  def traffic():
      # Main page
      return render_template('traffic.html')
  
  @app.route('/sleep')
  def sleep():
      # Main page
      return render_template('sleep.html')
  
  @app.route('/predict',methods=['POST'])
  def predict():
      '''
      For rendering results on HTML GUI
      '''
  
  
  
      classes = { 1:'Speed limit (20km/h)',
              2:'Speed limit (30km/h)',      
              3:'Speed limit (50km/h)',       
              4:'Speed limit (60km/h)',      
              5:'Speed limit (70km/h)',    
              6:'Speed limit (80km/h)',      
              7:'End of speed limit (80km/h)',     
              8:'Speed limit (100km/h)',    
              9:'Speed limit (120km/h)',     
             10:'No passing',   
             11:'No passing veh over 3.5 tons',     
             12:'Right-of-way at intersection',     
             13:'Priority road',    
             14:'Yield',     
             15:'Stop',       
             16:'No vehicles',       
             17:'Veh &gt; 3.5 tons prohibited',       
             18:'No entry',       
             19:'General caution',     
             20:'Dangerous curve left',      
             21:'Dangerous curve right',   
             22:'Double curve',      
             23:'Bumpy road',     
             24:'Slippery road',       
             25:'Road narrows on the right',  
             26:'Road work',    
             27:'Traffic signals',      
             28:'Pedestrians',     
             29:'Children crossing',     
             30:'Bicycles crossing',       
             31:'Beware of ice/snow',
             32:'Wild animals crossing',      
             33:'End speed + passing limits',      
             34:'Turn right ahead',     
             35:'Turn left ahead',       
             36:'Ahead only',      
             37:'Go straight or right',      
             38:'Go straight or left',      
             39:'Keep right',     
             40:'Keep left',      
             41:'Roundabout mandatory',     
             42:'End of no passing',      
             43:'End no passing veh &gt; 3.5 tons' }
  
  
  
  
      if request. method == "POST":
          #image=request. form["fileupload"]
  
          f = request.files['file']
  
          # Save the file to ./uploads
          basepath = os.path.dirname(__file__)
          file_path = os.path.join(
              basepath, 'uploads', secure_filename(f.filename))
          f.save(file_path)  
  
  
      image = Image.open(file_path)
      image = image.resize((30,30))
      image = numpy.expand_dims(image, axis=0)
      image = numpy.array(image)
  
      pred = model.predict_classes([image])[0]
  
      sign = classes[pred+1]
  
  
  
  
  
      return render_template('traffic.html', prediction_text='This sign represents {}'.format(sign))
  
  
  if __name__ == "__main__":
      app.run(debug=True)
  </code></pre>
  
  <p>I'm getting error</p>
  
  <p><strong>tensorflow.python.framework.errors_impl.InvalidArgumentError</strong>
  <strong>tensorflow.python.framework.errors_impl.InvalidArgumentError: Tensor conv2d_1_input:0, specified in</strong> <strong>either feed_devices or fetch_devices was not found in the Graph</strong></p>
  
  <p>what to do with it??</p>