reductionista commented on issue #14: Image loader python module, and demo 
notebook
URL: https://github.com/apache/madlib-site/pull/14#issuecomment-504127456
 
 
   > not sure if this is an error or not?
   > 
   > ```
   > import numpy as np
   > x1 = np.ones((3,4,5))
   > y1 = np.ones((1,1))
   > iloader = ImageLoader(num_workers=1, db_creds=db_creds)
   > iloader.load_np_array_to_table(x1, y1, 'test1', append=True, 
img_names=None)
   > 
   > x1
   > array([[[1., 1., 1., 1., 1.],
   >         [1., 1., 1., 1., 1.],
   >         [1., 1., 1., 1., 1.],
   >         [1., 1., 1., 1., 1.]],
   > 
   >        [[1., 1., 1., 1., 1.],
   >         [1., 1., 1., 1., 1.],
   >         [1., 1., 1., 1., 1.],
   >         [1., 1., 1., 1., 1.]],
   > 
   >        [[1., 1., 1., 1., 1.],
   >         [1., 1., 1., 1., 1.],
   >         [1., 1., 1., 1., 1.],
   >         [1., 1., 1., 1., 1.]]])
   > ```
   > 
   > ```
   > madlib=# select * from test1;
   >  id |                         x                         |  y  
   > ----+---------------------------------------------------+-----
   >   1 | {{1,1,1,1,1},{1,1,1,1,1},{1,1,1,1,1},{1,1,1,1,1}} | 1.0
   > (1 rows)
   > ```
   > 
   > did not load the whole array
   
   Outer dimension of x must match the dimension of y; since there is only 1 
label supplied here, so it matches that with the first image and ignores all 
the extra images.  I can't recall if we are supposed to be supporting 1-hot 
encoded labels passed from the user.  If we need to support that, then we can 
add that to our list of followup tasks after this merge; either way this 
specific case is a user error.  For now, I will add a check for this, so we can 
give an error message instead of proceeding with invalid input.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

Reply via email to