GithubHelp home page GithubHelp logo

asos / dsf2020 Goto Github PK

View Code? Open in Web Editor NEW
23.0 7.0 14.0 7.32 MB

Data Science Festival Workshop 7 November 2020 – Building a fashion recommender using Tensorflow/Keras with ASOS.

Jupyter Notebook 100.00%

dsf2020's Introduction

Data Science Festival X ASOS

Data Science Festival Workshop 7 November 2020 – Building a fashion recommender using Tensorflow/Keras with ASOS.

First we will build a recommender model together in Google Colab. Then we will deploy the model into production.

Before the workshop you can open the notebook by visiting Google Colab and clicking on 'File/Open Notebook'. In the orange window that opens click on "GitHub". Then in the 'Enter a GitHub URL or search by organization or user' line enter 'asos/dsf2020'. Finally click on "DSF-ASOS_Build_and_Deploy_a_Recommender_in_3_Hours.ipynb".

A note about the data

This repo contains four data files which will be used for training a recommender model. They contain product ids and fake user ids.

Serving a fashion recommender using Tensorflow serving

About Tensorflow serving

Tesnorflow serving is a flexible, high performance serving system for machine learning models.

Tensorflow serving serves model without running original Python code.

In order to serve a Tensorflow model, SavedModel is exported from a Python program.

A SavedModel contains a complete TensorFlow program, including weights and a graph definitions.

The recommended way of running Tensorflow serving is with Docker image.

Environment setup

Running tensorflow serving in local Docker container

CMD 1

cd {recommender-model-folder}

CMD 2

docker pull tensorflow/serving

CMD 3

_**Windows**_

docker run -d -p 8501:8501 -v "$PWD/:/models/recommender" -e MODEL_NAME=recommender tensorflow/serving


_**Mac**_

docker run -d -p 8501:8501 --mount type=bind,source=${PWD}/,target='/models/recommender' -e MODEL_NAME=recommender tensorflow/serving

CMD 4


_**Windows**_

$rec_request = @"
{
"signature_name" : "call_item_item",
"inputs" : {
"item": [123123]
}
}
"@


$rec_response = Invoke-RestMethod -Uri "http://localhost:8501/v1/models/recommender:predict" -Method Post -Body $rec_request -ContentType "application/json"
$rec_response | convertto-json

_**Mac**_
curl --header "Content-Type: application/json" --request POST --data '{"signature_name":"call_item_item","inputs": {"item": [123123] } }' http://localhost:8501/v1/models/recommender:predict

CMD 5

_**Windows**_

$output = Invoke-RestMethod http://localhost:8501/v1/models/recommender/metadata
$output | convertto-json
_**Mac**_

curl http://localhost:8501/v1/models/recommender/metadata

dsf2020's People

Contributors

neha-patel 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

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

dsf2020's Issues

tensorflow version used

Hi

When I run this in colab or my own docker instance I get syntax error

  File "<ipython-input-9-c352dfa2f358>", line 9
    self.user_embedding = tf.keras.layers.Embedding(len(dummy_users), ?)
                                                                      ^
SyntaxError: invalid syntax

Did you you a specific tensorflow version or tensorflow docker image?

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.