title: How to solve python model to called by a web using django
body: <p>i'm a beginner for python django, and i try to input my model (the model that i've train at google collab using CNN) for classification of Braille, but when i test the model, there is error like no such file or directory,why is the model doesnt work to classify the image input?</p>
  <p>can you solve this? am i wrong with the code?</p>
  <p>this is the code :</p>
  <pre><code>def prosesImg(request):
      filelink = request.POST.dict().get(&quot;myfiles&quot;)
  
      tf.compat.v1.disable_eager_execution()
      img_height, img_width=224,224
      model_graph = tf.Graph()
      with model_graph.as_default():
          tf_session=tf.compat.v1.Session()
          with tf_session.as_default():
              models=load_model('./model/BrailleNet.h5')
  
      testimage='.'+filelink
  
      img = image.load_img(testimage, target_size=(img_height, img_width))
      x = image.img_to_array(img)
      x = x / 255
      x = x.reshape(1, img_height, img_width, 3)
      with model_graph.as_default():
          with tf_session.as_default():
              predi = models.predict(x)
  
      if np.argmax(predi) == 0:
          predictedLabel = &quot;&quot;&quot;Classification : huruf A &lt;br/&gt;&quot;&quot;&quot;
  
      elif np.argmax(predi) == 1:
          predictedLabel = &quot;&quot;&quot;Classification : huruf B &lt;br/&gt;&quot;&quot;&quot;
  
      elif np.argmax(predi) == 1:
          predictedLabel = &quot;&quot;&quot;Classification : huruf C &lt;br/&gt;&quot;&quot;&quot;
  
      elif np.argmax(predi) == 1:
          predictedLabel = &quot;&quot;&quot;Classification : huruf D &lt;br/&gt;&quot;&quot;&quot;
  
      elif np.argmax(predi) == 1:
          predictedLabel = &quot;&quot;&quot;Classification : huruf E &lt;br/&gt;&quot;&quot;&quot;
  
      elif np.argmax(predi) == 1:
          predictedLabel = &quot;&quot;&quot;Classification : huruf F &lt;br/&gt;&quot;&quot;&quot;
  
      elif np.argmax(predi) == 1:
          predictedLabel = &quot;&quot;&quot;Classification : huruf G &lt;br/&gt;&quot;&quot;&quot;
  
      elif np.argmax(predi) == 1:
          predictedLabel = &quot;&quot;&quot;Classification : huruf H &lt;br/&gt;&quot;&quot;&quot;
  
      elif np.argmax(predi) == 1:
          predictedLabel = &quot;&quot;&quot;Classification : huruf I &lt;br/&gt;&quot;&quot;&quot;
  
      elif np.argmax(predi) == 1:
          predictedLabel = &quot;&quot;&quot;Classification : huruf J &lt;br/&gt;&quot;&quot;&quot;
  
      elif np.argmax(predi) == 1:
          predictedLabel = &quot;&quot;&quot;Classification : huruf K &lt;br/&gt;&quot;&quot;&quot;
  
      elif np.argmax(predi) == 1:
          predictedLabel = &quot;&quot;&quot;Classification : huruf L &lt;br/&gt;&quot;&quot;&quot;
  
      elif np.argmax(predi) == 1:
          predictedLabel = &quot;&quot;&quot;Classification : huruf M &lt;br/&gt;&quot;&quot;&quot;
  
      elif np.argmax(predi) == 1:
          predictedLabel = &quot;&quot;&quot;Classification : huruf N &lt;br/&gt;&quot;&quot;&quot;
  
      elif np.argmax(predi) == 1:
          predictedLabel = &quot;&quot;&quot;Classification : huruf O &lt;br/&gt;&quot;&quot;&quot;
  
      elif np.argmax(predi) == 1:
          predictedLabel = &quot;&quot;&quot;Classification : huruf P &lt;br/&gt;&quot;&quot;&quot;
  
      elif np.argmax(predi) == 1:
          predictedLabel = &quot;&quot;&quot;Classification : huruf Q &lt;br/&gt;&quot;&quot;&quot;
  
      elif np.argmax(predi) == 1:
          predictedLabel = &quot;&quot;&quot;Classification : huruf R &lt;br/&gt;&quot;&quot;&quot;
  
      elif np.argmax(predi) == 1:
          predictedLabel = &quot;&quot;&quot;Classification : huruf S &lt;br/&gt;&quot;&quot;&quot;
  
      elif np.argmax(predi) == 1:
          predictedLabel = &quot;&quot;&quot;Classification : huruf T &lt;br/&gt;&quot;&quot;&quot;
  
      elif np.argmax(predi) == 1:
          predictedLabel = &quot;&quot;&quot;Classification : huruf U &lt;br/&gt;&quot;&quot;&quot;
  
      elif np.argmax(predi) == 1:
          predictedLabel = &quot;&quot;&quot;Classification : huruf V &lt;br/&gt;&quot;&quot;&quot;
  
      elif np.argmax(predi) == 1:
          predictedLabel = &quot;&quot;&quot;Classification : huruf W &lt;br/&gt;&quot;&quot;&quot;
  
      elif np.argmax(predi) == 1:
          predictedLabel = &quot;&quot;&quot;Classification : huruf X &lt;br/&gt;&quot;&quot;&quot;
  
      elif np.argmax(predi) == 1:
          predictedLabel = &quot;&quot;&quot;Classification : huruf Y &lt;br/&gt;&quot;&quot;&quot;
  
      else:
          predictedLabel = &quot;&quot;&quot;Classification : huruf Z &lt;br/&gt;&quot;&quot;&quot;
  
      return render(request, 'classification/hasil.html', {
          'judul': 'Result',
          'subjudul': 'RESULT',
          'predictedLabel': predictedLabel,
          'predi': predi,
          'uploaded_file_url': filelink }
                    )
  </code></pre>