Aborting boot: directory mapped to /mldb_data owned by root
Expected owner uid from MLDB_IDS is: 1003
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.
Hello again
So I went with your suggestion @jeremybarnes , but I am stuck in one part where they created a filename (from a URL) and called the function. When I do that on a notebook in my machine (not live) I get an error saying that : Connection has no attributes called 'log' and 'sqlEscape'. I should mention that I started my code with :
from pymldb import Connection
mldb = Connection()
What is the problem exactly?
So instead of using the last part of the code I decided to query the model directly using :
mldb.query("SELECT imageEmbedding({url: '%s'}) as *" % filename)
Where filename is a URL to a given image. I am having the following error :
ResourceErrorTraceback (most recent call last)
<ipython-input-25-b0780527bbb0> in <module>()
----> 1 mldb.query("SELECT imageEmbedding({url: '%s'}) as *" % filename)
/usr/local/lib/python2.7/dist-packages/pymldb/init.pyc in query(self, sql, **kwargs)
81 """
82 if 'format' not in kwargs or kwargs['format'] == 'dataframe':
---> 83 resp = self.get('/v1/query', data={'q': sql, 'format': 'table'}).json()
84 if len(resp) == 0:
85 return pd.DataFrame()
/usr/local/lib/python2.7/dist-packages/pymldb/init.pyc in inner(args, **kwargs)
21 result = add_repr_html_to_response(fn(args, **kwargs))
22 if result.status_code < 200 or result.status_code >= 400:
---> 23 raise ResourceError(result)
24 return result
25 return inner
ResourceError: '400 Bad Request' response to 'GET http://localhost/v1/query'
{
"httpCode": 400,
"error": "Cannot read column \"softmax\" with no FROM clause."
}
tensorflow.model
query need to correspond with layer names, otherwise MLDB will look in an outer scope for the variable and not find it. You can either dump your graph with Tensorflow to understand the layer names, or use GET /v1/functions/<tfmodel function>/details to have a JSON dump, and look up the name of your layer there.
So as you suggested @jeremybarnes , I used mldb.get('/v1/functions/imageEmbedding/details') and I got a huge chunk of details but in the end there was :
final_result = SoftmaxT=DT_FLOAT, _device=\"/cpu:0\";
So what I did was to use 'final_result' as an output for my 'imageEmbedding' function and I got something different (which is kind of good!) , it was the following error :
"httpCode": 400,
"error": "Unable to run model: NodeDef mentions attr 'dct_method' not in Op<name=DecodeJpeg; signature=contents:string -> image:uint8; attr=channels:int,default=0; attr=ratio:int,default=1; attr=fancy_upscaling:bool,default=true; attr=try_recover_truncated:bool,default=false; attr=acceptable_fraction:float,default=1>; NodeDef: DecodeJpeg = DecodeJpegacceptable_fraction=1, channels=3, dct_method=\"\", fancy_upscaling=true, ratio=1, try_recover_truncated=false, _device=\"/job:localhost/replica:0/task:0/cpu:0\"\n\t [[Node: DecodeJpeg = DecodeJpegacceptable_fraction=1, channels=3, dct_method=\"\", fancy_upscaling=true, ratio=1, try_recover_truncated=false, _device=\"/job:localhost/replica:0/task:0/cpu:0\"]]"
Any ideas on what this means exactly? It's very confusing
This is my code if anyone wants to take a look at it, maybe you'll have some ideas ;)
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?
Fetcher
function returns a blob which is the full contents (HTTP body) of the URL that is fetched
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.
lookupLabels
function as you suggests associates labels with predictions based upon the index in the prediction vector.
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.
@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 ?
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?
-p <mldbport>:80
instead