Giter VIP home page Giter VIP logo

the-ai-summer / deep-learning-in-production Goto Github PK

View Code? Open in Web Editor NEW
1.1K 1.1K 237.0 57.61 MB

Build, train, deploy, scale and maintain deep learning models. Understand ML infrastructure and MLOps using hands-on examples.

Home Page: https://amzn.to/3oa50Vj

Python 0.88% Jupyter Notebook 99.12% Dockerfile 0.01%
ai cloud deep-learning deeplearning deployment machine-learning machinelearningproject neural-network production python semantic-segmentation tensorflow training unet

deep-learning-in-production's People

Contributors

black0017 avatar sergioskar 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  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

deep-learning-in-production's Issues

<Response [200]> with Flask Application

Hello,

Thanks for putting together such a nice and detailed tutorial on DL in production, I have learned a lot and it is clear you put a lot of effort in making everything concrete and clear.

I am now trying to solve an issue with the simple Flask application tutorial. After writing all the code, I always get a <Response [200]> error at the client side. I have debugged everything in the server and client side and all seems to be working: the input image from the client is correctly read and preprocessed, the network outputs correct values, but when the client gets a response I always get that error. The only message that appears on the server side is 127.0.0.1 - - [28/Mar/2021 10:17:00] "POST /infer HTTP/1.1" 200 -

I have even tried return "hello" in my infer method (inferrer.py) and the infer method (service.py) to make sure the return value is json serializable, but to no avail.

Do you have any suggestions on how to continue debugging? Thank you.

Issue

Hi @black0017 @SergiosKar
When i run this code from the article "Deploy a Deep Learning model as a web application using Flask and Tensorflow". I have a issue:
ModuleNotFoundError: No module named 'tensorflow_examples'
What should i do?
Best regards,
PeterPham

Issues with the function: "dummy_load_data" of the module model.tests.unet_test

I have an issue with the following functions. "dummy_load_data" loads the dummy dataset.

#function of the module: model.tests.unet_test
  def dummy_load_data(*args, **kwargs):
      with tfds.testing.mock_data(num_examples=1):
          return tfds.load(CFG['data']['path'], with_info=True)

#function of the class: model.tests.unet_test.UnetTest
   @patch('model.unet.DataLoader.load_data')
    def test_load_data(self, mock_data_loader):
        mock_data_loader.side_effect = dummy_load_data
        shape = tf.TensorShape([None, self.unet.image_size, self.unet.image_size, 3])

        self.unet.load_data()
        mock_data_loader.assert_called()

        self.assertItemsEqual(self.unet.train_dataset.element_spec[0].shape, shape)
        self.assertItemsEqual(self.unet.test_dataset.element_spec[0].shape, shape)

#functions (which are supposed to be tested with test_load_data function above) "load_data" and  "_preprocess_data" of the class: model.unet.Unet 
    def load_data(self):
            """Loads and Preprocess data """
            self.dataset, self.info = DataLoader().load_data(self.config.data)
            self._preprocess_data()
    
    def _preprocess_data(self):
            """ Splits into training and test and set training parameters"""
            train = self.dataset['train'].map(self._load_image_train, num_parallel_calls=tf.data.experimental.AUTOTUNE)
            test = self.dataset['test'].map(self._load_image_test)
    
            self.train_dataset = train.cache().shuffle(self.buffer_size).batch(self.batch_size).repeat()
            self.train_dataset = self.train_dataset.prefetch(buffer_size=tf.data.experimental.AUTOTUNE)
            self.test_dataset = test.batch(self.batch_size)

I want to test the load_data function of the class model.unet by using a dummy data , which is loaded with the function
dummy_load_data. (above)

When I´m testing the function "load_data" of the class model.unet, I get the following error:
train = self.dataset["train"].map(map_func =self._load_image_train, num_parallel_calls=tf.data.AUTOTUNE) KeyError: 'train'

I think its because the dummy_load_data function just loads one sample. So the returned dataset of the dummy_load_data function doesnt have the keys ["train"] and ["test"]. Therefore its not possible to access these keys in the _preprocess_data function.

But how can I create a mock dataset with the keys ["train"] and ["test"]?

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.