Deployment Platform: Render ✅

Hi there,

just a quick question: there is no free option anymore, right? I have to pick the 5$/mo pricing plan for deploying my toy service. Is that correct?

That is correct. Every service deployed on Render is a cost to us, and to build a long term sustainable service we do need to charge for compute resources.

2 Likes

I absolutely understand that. I was just surprised, because Jeremy mentioned in the video that it was free. I guess you guys have updated your pricing as the service matured. That’s totally fine. I just wanted to double-check, in case I missed some kind of voucher link or something. :sweat_smile:

Ah. Jeremy was probably referring to credits that we gave out prior to public launch. Our beta testers deserved it!

2 Likes

Hello everyone, I am trying to deploy my first classifier on Render.

I decided to install the bear classifier example in the production section of the course first, to reduce any issues I may have when installing my app.
Unfortunately when I press the deploy button on the Render Services page I receive the following error.

Jun 8 06:33:31 AM INFO[0195] RUN python app/server.py
Jun 8 06:33:34 AM Traceback (most recent call last):
File “app/server.py”, line 9, in
from fastai.vision import *
File “/usr/local/lib/python3.7/site-packages/fastai/vision/init.py”, line 3, in
from .learner import *
File “/usr/local/lib/python3.7/site-packages/fastai/vision/learner.py”, line 6, in
from . import models
File “/usr/local/lib/python3.7/site-packages/fastai/vision/models/init.py”, line 2, in
from torchvision.models import ResNet,resnet18,resnet34,resnet50,resnet101,resnet152
File “/usr/local/lib/python3.7/site-packages/torchvision/init.py”, line 1, in
from torchvision import models
File “/usr/local/lib/python3.7/site-packages/torchvision/models/init.py”, line 11, in
from . import detection
File “/usr/local/lib/python3.7/site-packages/torchvision/models/detection/init.py”, line 1, in
from .faster_rcnn import *
File “/usr/local/lib/python3.7/site-packages/torchvision/models/detection/faster_rcnn.py”, line 7, in
from torchvision.ops import misc as misc_nn_ops
File “/usr/local/lib/python3.7/site-packages/torchvision/ops/init.py”, line 1, in
from .boxes import nms, box_iou
File “/usr/local/lib/python3.7/site-packages/torchvision/ops/boxes.py”, line 2, in
from torchvision import _C
ImportError: libcudart.so.9.0: cannot open shared object file: No such file or directory
Jun 8 06:33:35 AM error building image: error building stage: waiting for process to exit: exit status 1
Jun 8 06:33:35 AM error: exit status 1

Does anyone have the solution to this problem or can someone suggest the best approach to solving this issue?
Thanks in advance.smiley::smiley:

I was using render too, now i switched over to Google App Engine. There is a tutorial on the course website on it, and not a bad way to make use of the free compute credits Google is providing for free.

3 Likes

Hi,

I am trying to deploy my model on Render, but getting the following error:
File “app/server.py”, line 48, in
learn = loop.run_until_complete(asyncio.gather(*tasks))[0]
File “/usr/local/lib/python3.7/asyncio/base_events.py”, line 584, in run_until_complete
return future.result()
File “app/server.py”, line 35, in setup_learner
learn = load_learner(path, export_file_name)
File “/usr/local/lib/python3.7/site-packages/fastai/basic_train.py”, line 598, in load_learner
state = torch.load(source, map_location=‘cpu’) if defaults.device == torch.device(‘cpu’) else torch.load(source)
File “/usr/local/lib/python3.7/site-packages/torch/serialization.py”, line 387, in load
return _load(f, map_location, pickle_module, **pickle_load_args)
File “/usr/local/lib/python3.7/site-packages/torch/serialization.py”, line 564, in _load
magic_number = pickle_module.load(f, **pickle_load_args)
_pickle.UnpicklingError: invalid load key, ‘<’.

Can anybody help?

I found somewhere that the following line of code should be used for pickle error :

from functools import partial
import pickle
pickle.load = partial(pickle.load, encoding=“latin1”)
pickle.Unpickler = partial(pickle.Unpickler, encoding=“latin1”)
model = torch.load(model_file, map_location=lambda storage, loc: storage, pickle_module=pickle

However now I m getting the following error now:
Jun 11 03:41:50 PM File “app/server.py”, line 17
Jun 11 03:41:50 PM export_file_url = ‘https://drive.google.com/uc?export=download&id=1-pQHp5iT5BiuyBchBq0yBYQIzmsM9is9
Jun 11 03:41:50 PM ^
Jun 11 03:41:50 PM error building image: error building stage: waiting for process to exit: exit status 1
Jun 11 03:41:50 PM SyntaxError: invalid syntax
Jun 11 03:41:50 PM error: exit status 1

What am I doing wrong? I have followed exactly the same instructions provided?

I had the same error.
Reuploading the model weights to drive/dropbox solved it.

I uploaded my export.pkl file to Google Drive and updated all the requisite libraries to match with the render requirements.txt and was still receiving the error:

_pickle.UnpicklingError: invalid load key, '<'.

After running the docker image locally I finally found the problem was because my .pkl file was over 25Mb. Google Drive prompts large download attempts with a warning page about virus scanning (even using that confirmation link as the download url fails!). The html warning page is downloaded instead

<!DOCTYPE html><html><head><title>Google Drive - Virus scan warning</title>
...
</html>

hence the invalid key <!
My solution was to upload to Dropbox where I didn’t have any problems…

If you must use Google Drive, use the Drive API:
https://developers.google.com/drive/api/v3/manage-downloads

3 Likes

Hello Adam,

I have the same error, but as it happens I did try dropbox as well but still got the same issue (see below).

How did you manage to get the full error description? I just want to confirm it’s a size error. I am using a free dropbox account, but I don’t think there is any limitations there. The link I have take me to a page where you have to click download. I’m wondering if that might the issue?

Regards

Dave

Ok, figured out what I was doing wrong!
The dropbox URL link was set with 0 at the end, and not 1. Set to one it allowed the file to download straight away

https://www.dropbox.com/s/jjvxmxe95pemfhc/cars99?dl=1

Dave

2 Likes

Getting the following error when deploying to render… any ideas?

  File "app/server.py", line 48, in <module>
    learn = loop.run_until_complete(asyncio.gather(*tasks))[0]
  File "/usr/local/lib/python3.7/asyncio/base_events.py", line 584, in run_until_complete
    return future.result()
  File "app/server.py", line 35, in setup_learner
    learn = load_learner(path, export_file_name)
  File "/usr/local/lib/python3.7/site-packages/fastai/basic_train.py", line 600, in load_learner
    src = LabelLists.load_state(path, state.pop('data'))
KeyError: 'data'

My model uses a PTH file and I see the export file name is a .pkl could that be the issue??

Did you ever get a solve for this? I am running in to a similar issue

am also having this error. can anyone help with this please.
have configure the requirement.txt and yet thesame error

please i need help. having being trying to deploy to render for some days now. and have tried every suggestion being made here, but still not working.

please what did you think might be happening.

Hi Stephen,

Where did you get that requirements.txt from? Did you create it yourself? It has different versions of things compared with the example from Anurag and co. here.
Having Googled your error messages (about numpy _multiarray_umath), I found this here saying that _multiarray_umath is new in numpy 1.16.0, whereas your requirements.txt asked for 1.15.1. That might be the problem?

I suggest trying to follow/use the example repo’s requirements.txt first, see if it works.

Good luck!

Yijin

Thanks.
I got the requirements.txt from pip list and some are already provided I’m d repo
I only change the torch version and numpy

I will change the numpy version to 1.16.0 and see if any change and also try the example.

Thanks

Hey - I was able to sort out this issue if you are still seeing it, there is an issue with the model file of some sort. I was passing off a PTH file instead of a PKL file to the server which caused the issue. Might be the same but the issue is that the pop function can’t find the key data

1 Like

have update the numpy and it has stopped showing the error. but it keeps showing the pickle error

and then i googled how to solve it, but the solution involved the encoding type to pickle
sol

is there a way to solve it. Thanks