bjorn
bjorn

Reputation: 338

Tensorflow TFLearn working example with TFLearn

I'm approaching to the world of deep learning, and the framework that I'm using is Tensorflow. In order to start quickly, I've seen that there are high level API called TFLearn, which makes the creation of a network a lot easier. Unfortunately, there are no working examples. In particular, I'm trying this example:

Example

but it can't find the layers. I've tried to import tflearn in this way:

import tensorflow.contrib.learn as tflearn

and the dataset in this way

import tensorflow.contrib.learn.python.learn.datasets.mnist as mnist

and they works, but I'm still not able to use the layers.

EDIT

I also tried to import in this way (as reported on tflearn github page):

import tensorflow.contrib.learn.python.learn as tflearn

and I get this error:

AttributeError: module 'tensorflow.contrib.learn.python.learn' has no attribute 'conv_2d'

What can I do?

Upvotes: 0

Views: 938

Answers (2)

CrisH
CrisH

Reputation: 280

Don't use

import tensorflow.contrib.learn as tflearn

Instead install tflearn in your terminal, using installation guide http://tflearn.org/installation/

Then, import like:

import tflearn
from tflearn.layers.core import input_data, dropout, fully_connected
from tflearn.layers.conv import conv_2d, max_pool_2d
from tflearn.layers.estimator import regression

This way you can use the layers.

Upvotes: 1

Dmitrii Sokolov
Dmitrii Sokolov

Reputation: 11

I also meet some strange errors with TFlearn... it seems it is not properly maintained and updated, so now it is not in sync with Tensorflow...

Upvotes: 1

Related Questions