Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
    sniper0110
    @sniper0110
    Oh I see, which version is MLDB using exactly ?
    Jeremy Barnes
    @jeremybarnes
    I think it's 0.10. We are moving to 1.1, but that work isn't finished yet.
    sniper0110
    @sniper0110
    What do you suggest @jeremybarnes ? I need to make an API before next Thursday and MLDB seemed the only relatively easy way to make it
    Jeremy Barnes
    @jeremybarnes
    You could either a) retrain your model using Tensorflow 0.10 (which should then be loadable by MLDB), or b) use a Python REST API framework to expose your model (which should be fine so long as performance isn't an issue)
    We won't have a release with Tensorflow 1.1 support before Thursday
    sniper0110
    @sniper0110
    Ok I see, I think I will first explore the second option, if I get lost I'll go back to option (a). Do you have any link to something similar to what I am trying to do, a tutorial-like kind of thing?
    sniper0110
    @sniper0110
    Hello again, so I was working on both options (in parallel) suggested by @jeremybarnes and it finally paid off. I retrained my model using tensorflow 0.1 and it's working perfectly :D. Thank you again for the help @jeremybarnes ;) I will be posting some theoretical questions soon to understand the working principles behind all of this.
    sniper0110
    @sniper0110

    So I gathered some questions regarding the working principles of MLDB. I hope you can help me answer them :)

    1) What is (DecodeJpeg/contents) node?

    2) The fetcher function downloads an image from a URL and turns it into a blob. What is a blob exactly?

    3) The procedure 'imageneLabels' reads the labels from a .txt file and puts them in a dataset. What kind of dataset is this?

    4) Is the function 'lookupLabels' only used to assign the probabilities of the predictions to the correct labels?

    5) In the main function 'imageEmbedding' there are two things that I don't quite understand:

    a) What does ('fetch({url})[content] AS "DecodeJpeg/contents"') mean exactly? I mean, we are turning an
    image into a blob using the fetch function but what does the second part (AS "DecodeJpeg/contents)
    do exaclty?

    b) In the output we are using a function called 'flatten', what is it doing?

    sniper0110
    @sniper0110
    Also, if someone wants to use this API to make predictions for types of food in a web application, a)how can he do that? b)Should I give him my retrained model or just the code?
    Jeremy Barnes
    @jeremybarnes
    1) The DecodeJpeg/contents node is the name of the variable that comes out of the JPEG decoder that's in the Tensorflow graph.
    2) The Fetcher function returns a blob which is the full contents (HTTP body) of the URL that is fetched
    3) The dataset type can be interrogated by asking to GET /v1/datasets/imagenetLabels to MLDB. The default dataset type is sparse.mutable which is a very general purpose dataset that can hold any data type, but is not particularly efficient at any operations.
    4) The lookupLabels function as you suggests associates labels with predictions based upon the index in the prediction vector.
    Jeremy Barnes
    @jeremybarnes
    5.a) When you call a Tensorflow graph, you provide inputs using the names in the Tensorflow graph. So in this case, we want to fetch the URL, take just the content (the binary blob with the JPEG encoded data), and feed it in to the DecodeJpeg/contents variable of the Tensorflow graph. In other words, we're taking something which looks like { content: <BLOB>, error: null } and turning it into { 'DecodeJpeg/contents': <BLOB> }. The AS operator is just like SQL: it renames columns from their default name into another name.
    5.b The output of the Tensorflow function is a 1x1008 matrix. By flattening it, we remove the first dimension and turn it into a simple 1008 element vector.
    If you want to look at how to turn an API into a webapp, you could look at the DeepTeach plugin or the handwriting recognition demo in the MLDB tutorials. You would normally need to give a person the retrained model so that they could load it up as they deploy the API.
    sniper0110
    @sniper0110
    Hello again,
    So I've been asked to deploy my API to a remote machine, it's a ubuntu machine that I have remote access to. How can I do that exactly? I need to deploy it so that someone else can test it.
    Since I am using docker to run MLDB, can I somehow deploy the container? Sorry if this sounds stupid because as I said before I m completely new to these things.
    sniper0110
    @sniper0110
    Any hints guys? I'm kinda stuck
    Jeremy Barnes
    @jeremybarnes
    That's a pretty heavy developer topic. Broadly, you'll have to create a docker container with MLDB as a base and an extra part on top that packages up your plugin, and then make the default command launch your plugin. The easiest way to do that is to make your plugin autoload.
    Or otherwise, start up the normal Docker container on the remote host (removing the localhost-only port binding so you can access it from other machines), then load up and run your notebook remotely from the host. That way the other person can connect to the same port on the remote machine to access the API.
    sniper0110
    @sniper0110
    Ok, I see. Well, I've been trying something myself, I was thinking of pushing the docker image (containing all the resources that I used to make the API) to docker hub and then pulling it from the remote machine. Can this be a solution?
    But I am having a problem when trying to push the image to docker hub, it says : (denied: requested access to the resource is denied)
    sniper0110
    @sniper0110

    @jeremybarnes , your second suggestion seems like an easy way out. I have ssh access to the remote host, I have installed docker in it. I believe you are talking about establishing a tunnel using ssh. Like on mldb website :

    ssh -f -o ExitOnForwardFailure=yes <user>@<remotehost> -L <localport>:127.0.0.1:<mldbport> -N

    So, now someone who has access to the remote host will also have access to mldb image that is on my local machine right ?

    sniper0110
    @sniper0110

    Now, that I have established a tunnel using ssh, should I use just :

    docker run --rm=true \
    -v </absolute/path/to/mldb_data>:/mldb_data \
    -e MLDB_IDS="id" \
    -p 127.0.0.1:<mldbport>:80 \
    quay.io/mldb/mldb:latest

    To access the container from the remote host?

    Jeremy Barnes
    @jeremybarnes
    Yes, that should do it
    If you want to allow anyone to connect (note: not recommended) you can use -p <mldbport>:80 instead
    that way the port 80 on the receiving machine will be open to the internet, and they won't need to connect via the SSH tunner
    tunnel
    sniper0110
    @sniper0110

    I did exactly that (I even allowed anyone to connect) and I got the following on my shell prompt :

    Aborting boot: directory mapped to /mldb_data owned by root

    Expected owner uid from MLDB_IDS is: 1001

    If the directory mapped to /mldb_data did not exist before launching MLDB,
    it is automatically created and owned by root. If this is what happened,
    please change the owner of the directory and relaunch.

    * /etc/my_init.d/05-mldb-id-mapping.sh failed with status 1

    PS : I tried to launch the container from the remote server.
    Jeremy Barnes
    @jeremybarnes
    You need to change to the directory from which you launched, and change the owner of mldb_data
    in order to avoid problems with files being owned by root, mldb needs the mldb_data directory to be owned by the current user. You can normally fix it with sudo chown $UID.$UID mldb_data in the current directory
    Gustavo Brian
    @gbrian
    Hi there!
    Nice tool, I'm trying to run KDNuggets Transfer Learning Blog Postwith my own set of images.
    After preparing images I still getting an exception during the call to inception seems that one of the images fails.
    How I can filter out those images failing withoout breaking whole process? Thanks
    Fran├žois Maillet
    @mailletf
    You can wrap the call to inception in a try() SQL statement. check the "Handling errors line by line" section here: https://docs.mldb.ai/doc/#builtin/sql/ValueExpression.md.html
    Gustavo Brian
    @gbrian
    @mailletf :+1:
    sniper0110
    @sniper0110
    Hello again,
    So after creating that API by using my re-trained model of inception, I want to know something. Since all of the mldb functions that I used make REST calls, can I make REST calls from ubuntu shell to the local server to predict food using that jupyter script? If yes, then how can I do that?
    Thanks in advance :)
    Jeremy Barnes
    @jeremybarnes
    Yes you can. You can use the curl command; there are plenty of tutorials out there on how to do that.
    sniper0110
    @sniper0110
    Alright, thanks for the quick answer @jeremybarnes :D
    datascienceit
    @datascienceit

    Hello,

    I'm trying to run mldb community on kubernetes, but can't managed to pass the ssh tunnel.
    I've opened the Node port, and port-proxy to the pod, but I get rejected by mldb, what to do?

    datascienceit
    @datascienceit
    And BTW, When will the enterprise version become open-sourced?
    Rodney Degracia
    @rdegraci
    After I build the MLDB Docker container, where is that container located on the machine ?
    I am just curious to know, since I have been getting this error when I try to start hte container: MLDB (version 2017.06.20.dev-e84f8da) is starting up
    /opt/bin/mldb_runner: error while loading shared libraries: libxml++-2.6.so.2: cannot open shared object file: No such file or directory
    Perhaps I need to go into the container and fix something ?
    Rodney Degracia
    @rdegraci
    In Ubuntu, the libxml++2.6.so is located in /usr/lib and I had to edit the ldconfig config files to add /usr/lib perhaps that needs to be done to the base MLDB Docker image ?
    Rodney Degracia
    @rdegraci

    Yeah something is definitely not right, when i git checkout v2017.01.24.0 and build MLDB, it runs with no issues: docker run --rm=true -v /home/ubuntu/mldb_data:/mldb_data -e MLDB_IDS="id" -p 8080:80 quay.io/mldb/mldb:ubuntu-HEAD-5b8653bc2828f1a89e23876e2d05c9a21dd2ed6a

    MLDB (version 2017.06.20.dev-5b8653b) is starting up
    reading configuration from file: '/etc/mldb.conf'

    MLDB ready

    Looks like, perhaps, some sort of CI needs to be set up that does a build and an initial smoke test, to make sure that the latest container actually runs
    Rodney Degracia
    @rdegraci
    Anyone alive ? :)
    Fran├žois-Michel L'Heureux
    @FinchPowers
    Hi @rdegraci
    Sorry for the delay
    I think the version of mldb_base we have online is too old. I'll push a new one.