karolzak / cntk-python-web-service-on-azure

This sample project shows off how to prepare and deploy to Azure Web Apps a simple Python web service with an image classifying model produced in CNTK (Cognitive Toolkit) using FasterRCNN
MIT License
26 stars 18 forks source link

TypeError: 'NoneType' object is not callable #5

Closed JonathanNorth closed 5 years ago

JonathanNorth commented 5 years ago

Hello,

I've followed the instructions for deploying the web app and I've ran into an issue. When I make a post request I get Error 500. I find the following error in logs

[2018-11-22 00:37:37,345] ERROR in app: Exception on /hotelidentifier/api/v1.0/evaluate/returntags [POST]
Traceback (most recent call last):
  File "D:\home\python354x64\lib\site-packages\flask\app.py", line 1982, in wsgi_app
    response = self.full_dispatch_request()
  File "D:\home\python354x64\lib\site-packages\flask\app.py", line 1614, in full_dispatch_request
    rv = self.handle_user_exception(e)
  File "D:\home\python354x64\lib\site-packages\flask\app.py", line 1517, in handle_user_exception
    reraise(exc_type, exc_value, tb)
  File "D:\home\python354x64\lib\site-packages\flask\_compat.py", line 33, in reraise
    raise value
  File "D:\home\python354x64\lib\site-packages\flask\app.py", line 1612, in full_dispatch_request
    rv = self.dispatch_request()
  File "D:\home\python354x64\lib\site-packages\flask\app.py", line 1598, in dispatch_request
    return self.view_functions[rule.endpoint](**req.view_args)
  File "D:\home\site\wwwroot\app.py", line 41, in return_tags
    return jsonify(tags=[e.serialize() for e in evaluateimage(temp_file_path,"returntags",eval_model=loadedModel)])
  File "D:\home\site\wwwroot\evaluate.py", line 176, in evaluateimage
    bgrPlotThreshold=cfg["CNTK"].RESULTS_BGR_PLOT_THRESHOLD)
  File "D:\home\site\wwwroot\evaluate.py", line 87, in eval_faster_rcnn
    frcn_eval = eval_model(image_input, dims_input)
TypeError: 'NoneType' object is not callable

I'm not sure exactly what's wrong. Any help would be appreciated

JonathanNorth commented 5 years ago

Nevermind, I figured it out. The model wasn't downloaded or I accidentally deleted it