I have two numpy arrays:

- One that contains captcha images
- Another that contains the corresponding labels (in one-hot vector format)

**I want to load these into TensorFlow so I can classify them using a neural network. How can this be done?**

What shape do the numpy arrays need to have?

Additional Info - My images are 60 (height) by 160 (width) pixels each and each of them have 5 alphanumeric characters. Here is a sample image:

Each label is a 5 by 62 array.

This question is related to
`python`

`numpy`

`machine-learning`

`tensorflow`

You can use `tf.convert_to_tensor()`

:

```
import tensorflow as tf
import numpy as np
data = [[1,2,3],[4,5,6]]
data_np = np.asarray(data, np.float32)
data_tf = tf.convert_to_tensor(data_np, np.float32)
sess = tf.InteractiveSession()
print(data_tf.eval())
sess.close()
```

Here's a link to the documentation for this method:

https://www.tensorflow.org/api_docs/python/tf/convert_to_tensor

- programming a servo thru a barometer
- Is there a way to view two blocks of code from the same file simultaneously in Sublime Text?
- python variable NameError
- Why my regexp for hyphenated words doesn't work?
- Comparing a variable with a string python not working when redirecting from bash script
- is it possible to add colors to python output?
- Get Public URL for File - Google Cloud Storage - App Engine (Python)
- Real time face detection OpenCV, Python
- xlrd.biffh.XLRDError: Excel xlsx file; not supported
- Could not load dynamic library 'cudart64_101.dll' on tensorflow CPU-only installation
- Upgrade to python 3.8 using conda
- Unable to allocate array with shape and data type
- How to fix error "ERROR: Command errored out with exit status 1: python." when trying to install django-heroku using pip
- How to prevent Google Colab from disconnecting?
- "UserWarning: Matplotlib is currently using agg, which is a non-GUI backend, so cannot show the figure." when plotting figure with pyplot on Pycharm
- How to fix 'Object arrays cannot be loaded when allow_pickle=False' for imdb.load_data() function?
- "E: Unable to locate package python-pip" on Ubuntu 18.04
- Tensorflow 2.0 - AttributeError: module 'tensorflow' has no attribute 'Session'
- Jupyter Notebook not saving: '_xsrf' argument missing from post
- How to Install pip for python 3.7 on Ubuntu 18?
- Python: 'ModuleNotFoundError' when trying to import module from imported package
- OpenCV TypeError: Expected cv::UMat for argument 'src' - What is this?
- Requests (Caused by SSLError("Can't connect to HTTPS URL because the SSL module is not available.") Error in PyCharm requesting website
- How to setup virtual environment for Python in VS Code?
- Pylint "unresolved import" error in Visual Studio Code
- Pandas Merging 101
- Numpy, multiply array with scalar
- What is the meaning of "Failed building wheel for X" in pip install?
- Selenium: WebDriverException:Chrome failed to start: crashed as google-chrome is no longer running so ChromeDriver is assuming that Chrome has crashed
- Could not install packages due to an EnvironmentError: [Errno 13]
- OpenCV !_src.empty() in function 'cvtColor' error
- ConvergenceWarning: Liblinear failed to converge, increase the number of iterations
- How to downgrade python from 3.7 to 3.6
- I can't install pyaudio on Windows? How to solve "error: Microsoft Visual C++ 14.0 is required."?
- Iterating over arrays in Python 3
- How do I install opencv using pip?
- How do I install Python packages in Google's Colab?
- How do I use TensorFlow GPU?
- How to upgrade Python version to 3.7?
- How to resolve TypeError: can only concatenate str (not "int") to str
- How can I install a previous version of Python 3 in macOS using homebrew?
- Flask at first run: Do not use the development server in a production environment
- TypeError: only integer scalar arrays can be converted to a scalar index with 1D numpy indices array
- What is the difference between Jupyter Notebook and JupyterLab?
- Pytesseract : "TesseractNotFound Error: tesseract is not installed or it's not in your path", how do I fix this?
- Could not install packages due to a "Environment error :[error 13]: permission denied : 'usr/local/bin/f2py'"
- How do I resolve a TesseractNotFoundError?
- Trying to merge 2 dataframes but get ValueError
- Authentication plugin 'caching_sha2_password' is not supported
- Python Pandas User Warning: Sorting because non-concatenation axis is not aligned
- [Move to How to convert numpy arrays to standard TensorFlow format?]

- Unable to allocate array with shape and data type
- How to fix 'Object arrays cannot be loaded when allow_pickle=False' for imdb.load_data() function?
- Numpy, multiply array with scalar
- TypeError: only integer scalar arrays can be converted to a scalar index with 1D numpy indices array
- Could not install packages due to a "Environment error :[error 13]: permission denied : 'usr/local/bin/f2py'"
- Pytorch tensor to numpy array
- Numpy Resize/Rescale Image
- what does numpy ndarray shape do?
- How to round a numpy array?
- numpy array TypeError: only integer scalar arrays can be converted to a scalar index
- Convert np.array of type float64 to type uint8 scaling values
- How to import cv2 in python3?
- How to calculate 1st and 3rd quartiles?
- Counting unique values in a column in pandas dataframe like in Qlik?
- Binning column with python pandas
- convert array into DataFrame in Python
- How to change a single value in a NumPy array?
- 'DataFrame' object has no attribute 'sort'
- ValueError: could not broadcast input array from shape (224,224,3) into shape (224,224)
- Pytorch reshape tensor dimension
- Python "TypeError: unhashable type: 'slice'" for encoding categorical data
- len() of a numpy array in python
- ValueError: cannot reshape array of size 30470400 into shape (50,1104,104)
- Python - AttributeError: 'numpy.ndarray' object has no attribute 'append'
- How to plot vectors in python using matplotlib
- How to plot an array in python?
- TypeError: 'DataFrame' object is not callable
- LogisticRegression: Unknown label type: 'continuous' using sklearn in python
- Python Pandas - Missing required dependencies ['numpy'] 1
- Pandas Split Dataframe into two Dataframes at a specific row
- What does 'index 0 is out of bounds for axis 0 with size 0' mean?
- What is the difference between i = i + 1 and i += 1 in a 'for' loop?
- Get index of a row of a pandas dataframe as an integer
- FutureWarning: elementwise comparison failed; returning scalar, but in the future will perform elementwise comparison
- TensorFlow ValueError: Cannot feed value of shape (64, 64, 3) for Tensor u'Placeholder:0', which has shape '(?, 64, 64, 3)'
- How to get element-wise matrix multiplication (Hadamard product) in numpy?
- Showing ValueError: shapes (1,3) and (1,3) not aligned: 3 (dim 1) != 1 (dim 0)
- Pandas: convert dtype 'object' to int
- ValueError: all the input arrays must have same number of dimensions
- Numpy: Checking if a value is NaT
- How to split data into 3 sets (train, validation and test)?
- Pandas: Subtracting two date columns and the result being an integer
- How to get the indices list of all NaN value in numpy array?
- What is dtype('O'), in pandas?
- ImportError: cannot import name NUMPY_MKL
- why numpy.ndarray is object is not callable in my simple for python loop
- How to convert numpy arrays to standard TensorFlow format?
- ValueError when checking if variable is None or numpy.array
- TypeError: only length-1 arrays can be converted to Python scalars while plot showing
- TypeError: Invalid dimensions for image data when plotting array with imshow()
- [Move to How to convert numpy arrays to standard TensorFlow format?]

- Error in Python script "Expected 2D array, got 1D array instead:"?
- How to predict input image using trained model in Keras?
- What is the role of "Flatten" in Keras?
- How to concatenate two layers in keras?
- How to save final model using keras?
- scikit-learn random state in splitting dataset
- Why binary_crossentropy and categorical_crossentropy give different performances for the same problem?
- What is the meaning of the word logits in TensorFlow?
- Can anyone explain me StandardScaler?
- Can Keras with Tensorflow backend be forced to use CPU or GPU at will?
- How to get Tensorflow tensor dimensions (shape) as int values?
- Deep-Learning Nan loss reasons
- How to split data into 3 sets (train, validation and test)?
- Accuracy Score ValueError: Can't Handle mix of binary and continuous target
- How can I run Tensorboard on a remote server?
- TensorFlow, "'module' object has no attribute 'placeholder'"
- How can I one hot encode in Python?
- Keras model.summary() result - Understanding the # of Parameters
- How to convert numpy arrays to standard TensorFlow format?
- TensorFlow: "Attempting to use uninitialized value" in variable initialization
- How to load a model from an HDF5 file in Keras?
- How to implement the Softmax function in Python
- How to interpret "loss" and "accuracy" for a machine learning model
- What is logits, softmax and softmax_cross_entropy_with_logits?
- Tensorflow: how to save/restore a model?
- Is it possible to append Series to rows of DataFrame without making a list first?
- How to implement the ReLU function in Numpy
- How to compute precision, recall, accuracy and f1-score for the multiclass case with scikit learn?
- Scikit-learn: How to obtain True Positive, True Negative, False Positive and False Negative
- Convert array of indices to 1-hot encoded numpy array
- How to extract the decision rules from scikit-learn decision-tree?
- gradient descent using python and numpy
- Is there a rule-of-thumb for how to divide a dataset into training and validation sets?
- What is the difference between linear regression and logistic regression?
- Python: tf-idf-cosine: to find document similarity
- What are advantages of Artificial Neural Networks over Support Vector Machines?
- Save classifier to disk in scikit-learn
- A simple explanation of Naive Bayes Classification
- Difference between classification and clustering in data mining?
- Calculate AUC in R?
- Epoch vs Iteration when training neural networks
- Why do we have to normalize the input for an artificial neural network?
- What is the role of the bias in neural networks?
- How to write a confusion matrix in Python?
- What is the difference between supervised learning and unsupervised learning?
- What is the difference between a generative and a discriminative algorithm?
- [Move to How to convert numpy arrays to standard TensorFlow format?]

- Could not load dynamic library 'cudart64_101.dll' on tensorflow CPU-only installation
- Module 'tensorflow' has no attribute 'contrib'
- Tensorflow 2.0 - AttributeError: module 'tensorflow' has no attribute 'Session'
- Could not install packages due to an EnvironmentError: [WinError 5] Access is denied:
- How do I use TensorFlow GPU?
- Which TensorFlow and CUDA version combinations are compatible?
- Could not find a version that satisfies the requirement tensorflow
- pip3: command not found
- How to import keras from tf.keras in Tensorflow?
- Your CPU supports instructions that this TensorFlow binary was not compiled to use: AVX AVX2
- Tensorflow import error: No module named 'tensorflow'
- How to downgrade tensorflow, multiple versions possible?
- Can I run Keras model on gpu?
- How to check if keras tensorflow backend is GPU or CPU version?
- how to install tensorflow on anaconda python 3.6
- What is the role of "Flatten" in Keras?
- Running Tensorflow in Jupyter Notebook
- Update TensorFlow
- Tensorflow r1.0 : could not a find a version that satisfies the requirement tensorflow
- ImportError: No module named tensorflow
- On Windows, running "import tensorflow" generates No module named "_pywrap_tensorflow" error
- Keras, How to get the output of each layer?
- What is the meaning of the word logits in TensorFlow?
- How to compile Tensorflow with SSE4.2 and AVX instructions?
- Installing TensorFlow on Windows (Python 3.6.x)
- Can Keras with Tensorflow backend be forced to use CPU or GPU at will?
- How to get Tensorflow tensor dimensions (shape) as int values?
- TensorFlow ValueError: Cannot feed value of shape (64, 64, 3) for Tensor u'Placeholder:0', which has shape '(?, 64, 64, 3)'
- Deep-Learning Nan loss reasons
- Cannot import keras after installation
- TensorFlow not found using pip
- How to get current available GPUs in tensorflow?
- How to find which version of TensorFlow is installed in my system?
- How to tell if tensorflow is using gpu acceleration from inside python shell?
- How can I run Tensorboard on a remote server?
- Tensorflow set CUDA_VISIBLE_DEVICES within jupyter
- Using Keras & Tensorflow with AMD GPU
- What is the difference between 'SAME' and 'VALID' padding in tf.nn.max_pool of tensorflow?
- How to run Tensorflow on CPU
- TensorFlow, "'module' object has no attribute 'placeholder'"
- Installing tensorflow with anaconda in windows
- How to get the dimensions of a tensor (in TensorFlow) at graph construction time?
- How to convert numpy arrays to standard TensorFlow format?
- In Tensorflow, get the names of all the Tensors in a graph
- TensorFlow: "Attempting to use uninitialized value" in variable initialization
- Disable Tensorflow debugging information
- What is logits, softmax and softmax_cross_entropy_with_logits?
- How to assign a value to a TensorFlow variable?
- How to prevent tensorflow from allocating the totality of a GPU memory?
- Convert a tensor to numpy array in Tensorflow?
- [Move to How to convert numpy arrays to standard TensorFlow format?]