Solved by ptrblck in post #2 
              
              
                You would have to map the words to indices as e.g. described in this tutorial first and could then create the tensors containing the numerical values. 
The second error is raised, if the JPEG file descriptor instead of an already loaded image array is passed to the tensor creation. Make sure img is …