In case anyone needs to deploy CycleGan of course v3 to Render, I created a sample that uses generator of the CycleGan and the api takes image and returns styled image. You can use it as a starter for any style transfer api. I also fixed the requirements for the people who train on Colab. It means you can train on Google Colab and export pkl and use it directly on Render. Current model in my repo is trained to draw sketch of portraits (still tranining though).
You can replace it with your own models just be sure that dropbox link has “?dl=1” in the end to start downloading immediately otherwise you will have unpickle error “_pickle.UnpicklingError: invalid load key, ‘<’.”
What version of python are you using in your venv environment?
I believe that ‘set_coroutine_wrapper’ has been removed in python 3.8, so you may have to run or train your model in python 3.7 where I believe it was deprecated but is still included.
If you have not done so already, the first step you should do is search this thread for pip list and make sure you have done what the post’s say.
If you still have an error and you can’t find it on the render platform.
I suggest you install a virtual env on your desktop deploy your app there and test it. This way you will be able to see the error that is causing the internal server error.
Managed to deploy( server is working ) but there is error ( please see the following )
Does this mean that your app is working and can make predictions satisfactorily?
As if the model is working we don’t want to break it.
The error in your pastebin is often seen when there are or is a difference in the versions of library you used to train your model.
Is the requirements.txt in your post identical/same as the one you trained your model on?
I use Google Colab to train my models. But often deploy them on many different platforms. I normally deploy them with in 30 minutes of training the model as this is the only way I can can be sure that there have been no changes in any single library since I trained the model.
In order to get rid of the error, its likely you will need to confirm the libraries you are using in your requirments.txt in production are identical to the platform versions you used on the date you trained your model.
The torch versions look like a good place to start.
I would back up the current deployed version and redeploy it with a different version if there is a difference.
If that doesn’t work I would retrain the model and deploy it immediately checking that the library versions between training and platform deployment in requirements.txt are identical.
Hi andrew77 I hope you are still having a wonderful day!
can you run pip freeze on your training platform and on your deployment platform and confirm all libraries used in requirements.txt are identical versions and paste them here please both lists here please.
My solution, and I think it’ll work for everyone, is directly edit your file on GitHub instead of downloading it. It’s easy and no hassle with the versions.
I tried modifying to the following but unsuccessful. I think it’s the mix and match thingy between fast.ai , torch and torchvision. Is there a ‘fail proof’ way to do so?
Hi andrew77
You need to change the version of fastai also your reqirements.txt should equal your Colab file versions as these are the ones you trained your model on.
Well done! remember you will have to go through this process every time you make a model as you never know if a library has had even a minor change which may break another library.
Doing these steps makes finding faults much easier.
Hey guys, render works fantastic so far! Started with GCP but gave up after an hour. Render deploy went seamlessly. Need to work on the model but considering this is my first deployment ever, I am loving it! https://house-plant-classifier.onrender.com/
Hello folks, I would like to ask you a very silly question because I see everyone is doing a great job deploying apps.
Context: I tried to deploy mine, in fact I just changed the resulting model url in the server.py file but the application is the same, detect bears. I tried this because I wanted to see by myself it really worked before coding my own application.
Problem: If you go my site url, the site is all white, blank, nada. Should I wait some time before it deploys?, did I miss something?, I even added my cc number because I thought that was the reason.
I temporarily suspended the site to avoid charges.
More context:
The requirements.txt file was updated because I trained the model using Colab.
Render has permission to access my Github account.
I carefully followed the instructions in the production section, I don’t know what could be wrong.
Instead of downloading the model every time, is there a way to store it in render and access it directly?
If so how do I access the model stored in render?
Will storing it in render increase the response time?