H
H
Hcuy2020-06-14 18:48:01
Python
Hcuy, 2020-06-14 18:48:01

Can't feed dataset to neural network?

Hello!
I can't figure out how to feed the neural network dataset. I want to use this www.ee.surrey.ac.uk/CVSSP/demos/chars74k
The problem is that in the documentation for tenserflow, the dataset built into the framework itself is used everywhere.
I tried to do like this:

from __future__ import absolute_import, division, print_function, unicode_literals

# TensorFlow и tf.keras
import tensorflow as tf
from tensorflow import keras

# Вспомогательные библиотеки
import numpy as np
import matplotlib.pyplot as plt

print(tf.__version__)
from tensorflow.contrib.learn.python.learn.datasets.mnist import extract_images, extract_labels

with open('ListsTXT .tgz') as f:
  train_labels = extract_labels(f)

with open('EnglishImg.tgz') as f:
  train_image = extract_image(f)

But alas, it doesn't work. Mistake:
from tensorflow.contrib.learn.python.learn.datasets.mnist import extract_images, extract_labels
ModuleNotFoundError: No module named 'tensorflow.contrib'

How to fix it? Or is there another way to upload your dataset?
Thank you!

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
dmshar, 2020-06-14
@dmshar

The very first Google response answered:
"Warning: The tf.contrib module is not included in TensorFlow 2 . Many of its submodules have been integrated into TensorFlow core, or spun-off into other projects like tensorflow_io, or tensorflow_addons. For instructions on how to upgrade see the Migration guide."

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question