Giter VIP home page Giter VIP logo

gallery's Introduction

BentoML

BentoML Gallery ๐ŸŽจ Twitter Follow Slack

BentoML Gallery project has been deprecated. All samples under the gallery projects have been moved under BentoML/examples directory.

๐Ÿ‘‰ Pop into our Slack community! We're happy to help with any issue you face or even just to meet you and hear what you're working on :)

gallery's People

Contributors

1e0ng avatar aarnphm avatar akainth015 avatar bojiang avatar cqvu avatar deehrlic avatar khuyentran1401 avatar korusuke avatar larme avatar narennadig avatar parano avatar rachaelroland avatar rhbian avatar sauyon avatar shafu0x avatar ssheng avatar theopinard avatar thoo avatar timliubentoml avatar vedangnadkarni avatar viettel-solutions avatar xiwang129 avatar yashika51 avatar yetone avatar yubozhao avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

gallery's Issues

RuntimeError: Input type (torch.cuda.FloatTensor) and weight type (torch.cuda.HalfTensor) should be the same

#on loading model with, Path having export.pkl file.
learn = load_learner(Path)
#on executing pet_classification.py and saving service
service = NormAbnormClassification.pack(export=learn)
saved_path = service.save()

I am getting following error on trying to predict result for an image.png file. File is of dimension 256x256 and model was also trained on same dimension file.
RuntimeError Traceback (most recent call last)
in
1 service = load(saved_path)
2
----> 3 print(service.predict(data.get(0)))

~/Richesh/AfterOctober2018/Notebooks/RnDNotebooksAndPythonScripts/normAbnormClassifier.py in predict(self, image)
11 def predict(self, image):
12 #result = self.artifacts.pet_classifer.predict(image)
---> 13 result = self.artifacts.export.predict(image)
14 return str(result)

~/anaconda3/envs/fastai/lib/python3.6/site-packages/fastai/basic_train.py in predict(self, item, return_x, batch_first, with_dropout, **kwargs)
369 "Return predicted class, label and probabilities for item."
370 batch = self.data.one_item(item)
--> 371 res = self.pred_batch(batch=batch, with_dropout=with_dropout)
372 raw_pred,x = grab_idx(res,0,batch_first=batch_first),batch[0]
373 norm = getattr(self.data,'norm',False)

~/anaconda3/envs/fastai/lib/python3.6/site-packages/fastai/basic_train.py in pred_batch(self, ds_type, batch, reconstruct, with_dropout, activ)
348 activ = ifnone(activ, _loss_func2activ(self.loss_func))
349 with torch.no_grad():
--> 350 if not with_dropout: preds = loss_batch(self.model.eval(), xb, yb, cb_handler=cb_handler)
351 else: preds = loss_batch(self.model.eval().apply(self.apply_dropout), xb, yb, cb_handler=cb_handler)
352 res = activ(preds[0])

~/anaconda3/envs/fastai/lib/python3.6/site-packages/fastai/basic_train.py in loss_batch(model, xb, yb, loss_func, opt, cb_handler)
24 if not is_listy(xb): xb = [xb]
25 if not is_listy(yb): yb = [yb]
---> 26 out = model(*xb)
27 out = cb_handler.on_loss_begin(out)
28

~/anaconda3/envs/fastai/lib/python3.6/site-packages/torch/nn/modules/module.py in call(self, *input, **kwargs)
539 result = self._slow_forward(*input, **kwargs)
540 else:
--> 541 result = self.forward(*input, **kwargs)
542 for hook in self._forward_hooks.values():
543 hook_result = hook(self, input, result)

~/anaconda3/envs/fastai/lib/python3.6/site-packages/torch/nn/modules/container.py in forward(self, input)
90 def forward(self, input):
91 for module in self._modules.values():
---> 92 input = module(input)
93 return input
94

~/anaconda3/envs/fastai/lib/python3.6/site-packages/torch/nn/modules/module.py in call(self, *input, **kwargs)
539 result = self._slow_forward(*input, **kwargs)
540 else:
--> 541 result = self.forward(*input, **kwargs)
542 for hook in self._forward_hooks.values():
543 hook_result = hook(self, input, result)

~/anaconda3/envs/fastai/lib/python3.6/site-packages/torch/nn/modules/container.py in forward(self, input)
90 def forward(self, input):
91 for module in self._modules.values():
---> 92 input = module(input)
93 return input
94

~/anaconda3/envs/fastai/lib/python3.6/site-packages/torch/nn/modules/module.py in call(self, *input, **kwargs)
539 result = self._slow_forward(*input, **kwargs)
540 else:
--> 541 result = self.forward(*input, **kwargs)
542 for hook in self._forward_hooks.values():
543 hook_result = hook(self, input, result)

~/anaconda3/envs/fastai/lib/python3.6/site-packages/torch/nn/modules/conv.py in forward(self, input)
343
344 def forward(self, input):
--> 345 return self.conv2d_forward(input, self.weight)
346
347 class Conv3d(_ConvNd):

~/anaconda3/envs/fastai/lib/python3.6/site-packages/torch/nn/modules/conv.py in conv2d_forward(self, input, weight)
340 _pair(0), self.dilation, self.groups)
341 return F.conv2d(input, weight, self.bias, self.stride,
--> 342 self.padding, self.dilation, self.groups)
343
344 def forward(self, input):

RuntimeError: Input type (torch.cuda.FloatTensor) and weight type (torch.cuda.HalfTensor) should be the same

ModuleNotFoundError: No module named 'imageio'

Hello there!
I am trying to run the Fast AI Pet Image classification example but I'm facing the following issue
Screenshot 2020-01-16 at 5 20 29 PM
Please check it and let me know the solution for it to run. Thanks in advance.

Update examples to 0.9.0

  • e2e
  • fast-ai
  • fasttext
  • h2o
  • legacy-keras
  • lightbgm
  • onnx
  • pytorch
  • sklearn
  • spacy
  • statsmodels_holt
  • tensorflow
  • xgboost

required positional argument: 'name'

I am new to this topic and exploring the example. By following all the instructions I am facing following issue:
Traceback (most recent call last):
File "/Users/awais/Python_Projects/TextClasificationTest/import_service.py", line 10, in
bento_svc = serviceClass.pack(model=model,word_index=word_index)
TypeError: pack() missing 1 required positional argument: 'name'
where is this missing argument 'name' and from where it has to pass? Please guide me on it. Thanks

FastAi1 Sample Note Working - fast-ai-pet-image-classification.ipynb

Attempting to run pet image classification sample. Get error below. Can't find FastaiImageInput in bentoml.adapters code. Got "getting started" notebook to run. Using fresh env with only BentoML requirements.

Is it just the notebook that needs to be updated?

ImportError Traceback (most recent call last)
in
1 # 1) import the custom BentoService defined above
----> 2 from pet_classification import PetClassification
3
4 # 2) pack it with required artifacts
5 service = PetClassification()

/workspace/BentoML/gallery/fast-ai/pet-image-classification/pet_classification.py in
2 from bentoml import BentoService, api, env, artifacts
3 from bentoml.artifact import FastaiModelArtifact
----> 4 from bentoml.adapters import FastaiImageInput
5
6 @env(pip_dependencies=['fastai'])

ImportError: cannot import name 'FastaiImageInput' from 'bentoml.adapters' (/opt/conda/lib/python3.7/site-packages/bentoml/adapters/init.py)

'Service Unavailable' with REST API Model Serving

Hi team,

I just tried the example in https://github.com/bentoml/gallery/blob/master/paddlehub/image-segmentation/image-segmentation.ipynb , only I ran the code in Pycharm Python Console (not jupyterbook).

Everything went fine till

# Start a dev model server to test out everything
bento_svc.start_dev_server()

I could get correct results in postman, the code was like

curl --location --request POST 'http://0.0.0.0:5000/predict' \
--header 'Content-Type: image/jpeg' \
--data-binary '@test_image.jpg'

But the code bento_svc.stop_dev_server() made Pycharm quit. Which was not expected. It should only stop bento_svc.

Another issue is that after saving the service with saved_path = bento_svc.save(), I could lauch API model serving with bentoml serve PaddleHubService:latest, but when I sent request with postman, it returned Service Unavailabel. However, in the meantime, bentoml run PaddleHubService:latest predict --input-file test_image.jpg returned the correct results.

One more thing, it looks like you are using original Flask as the rest api server, is it a good choice for production services?

Thanks a lot๏ผ

Update examples to use ngrok

With the release of 0.8.4 BentoML supports --run-with-ngrok which makes it easy to test notebooks in colab. We should update all the applicable examples to use this.

Also, add ngrok to documentation.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.