Skip to content

Commit

Permalink
TFLearn v0.5.0 Release (#1157)
Browse files Browse the repository at this point in the history
* add tf2 support

* cleanup

* update to 0.5.0
  • Loading branch information
aymericdamien committed Nov 11, 2020
1 parent 5c23566 commit 6e38143
Show file tree
Hide file tree
Showing 61 changed files with 109 additions and 77 deletions.
11 changes: 9 additions & 2 deletions README.md
Expand Up @@ -18,7 +18,7 @@ TFLearn features include:

The high-level API currently supports most of recent deep learning models, such as Convolutions, LSTM, BiRNN, BatchNorm, PReLU, Residual networks, Generative networks... In the future, TFLearn is also intended to stay up-to-date with latest deep learning techniques.

Note: Latest TFLearn (v0.3) is only compatible with TensorFlow v1.0 and over.
Note: Latest TFLearn (v0.5) is only compatible with TensorFlow v2.0 and over.

## Overview
```python
Expand Down Expand Up @@ -50,11 +50,18 @@ model.generate(50, temperature=1.0)

There are many more examples available *[here](http://tflearn.org/examples)*.

## Compatibility
TFLearn is based on the original tensorflow v1 graph API. When using TFLearn, make sure to import tensorflow that way:
```
import tflearn
import tensorflow.compat.v1 as tf
```

## Installation

**TensorFlow Installation**

TFLearn requires Tensorflow (version 1.0+) to be installed.
TFLearn requires Tensorflow (version 2.0+) to be installed.

To install TensorFlow, simply run:
```
Expand Down
19 changes: 19 additions & 0 deletions RELEASE.md
@@ -1,3 +1,22 @@
# Release 0.5.0

Major changes:
- TensorFlow 2.3.0 support
- Refactoring source to use tf.compat.v1

Minor changes:
- Update documentation
- Various bug fix

# Release 0.4.0

Major changes:
- Added new estimators (RandomForest, KMeans)

Minor changes:
- Added distance ops
- Various bug fix

# Release 0.3.2

Major changes:
Expand Down
2 changes: 1 addition & 1 deletion examples/basics/logical.py
Expand Up @@ -5,7 +5,7 @@

from __future__ import absolute_import, division, print_function

import tensorflow as tf
import tensorflow.compat.v1 as tf
import tflearn

# Logical NOT operator
Expand Down
2 changes: 1 addition & 1 deletion examples/basics/weights_loading_scope.py
Expand Up @@ -10,7 +10,7 @@

import re
import tflearn
import tensorflow as tf
import tensorflow.compat.v1 as tf
import tflearn.datasets.mnist as mnist

from tflearn.layers.core import input_data, dropout, fully_connected
Expand Down
2 changes: 1 addition & 1 deletion examples/extending_tensorflow/builtin_ops.py
Expand Up @@ -5,7 +5,7 @@
Tensorflow graph.
"""

import tensorflow as tf
import tensorflow.compat.v1 as tf
import tflearn

# ----------------------------------
Expand Down
2 changes: 1 addition & 1 deletion examples/extending_tensorflow/layers.py
Expand Up @@ -4,7 +4,7 @@
"""
from __future__ import print_function

import tensorflow as tf
import tensorflow.compat.v1 as tf
import tflearn

# --------------------------------------
Expand Down
2 changes: 1 addition & 1 deletion examples/extending_tensorflow/summaries.py
Expand Up @@ -32,7 +32,7 @@
"""

import tensorflow as tf
import tensorflow.compat.v1 as tf
import tflearn

# Loading MNIST dataset
Expand Down
2 changes: 1 addition & 1 deletion examples/extending_tensorflow/trainer.py
Expand Up @@ -3,7 +3,7 @@
TFLearn wrappers regular Tensorflow expressions.
"""

import tensorflow as tf
import tensorflow.compat.v1 as tf
import tflearn

# ----------------------------
Expand Down
2 changes: 1 addition & 1 deletion examples/extending_tensorflow/variables.py
Expand Up @@ -7,7 +7,7 @@
variables.
"""

import tensorflow as tf
import tensorflow.compat.v1 as tf
import tflearn
import tflearn.variables as va

Expand Down
2 changes: 1 addition & 1 deletion examples/images/dcgan.py
Expand Up @@ -17,7 +17,7 @@

import matplotlib.pyplot as plt
import numpy as np
import tensorflow as tf
import tensorflow.compat.v1 as tf
import tflearn

# Data loading and preprocessing
Expand Down
2 changes: 1 addition & 1 deletion examples/images/gan.py
Expand Up @@ -18,7 +18,7 @@

import matplotlib.pyplot as plt
import numpy as np
import tensorflow as tf
import tensorflow.compat.v1 as tf
import tflearn

# Data loading and preprocessing
Expand Down
2 changes: 1 addition & 1 deletion examples/images/variational_autoencoder.py
Expand Up @@ -22,7 +22,7 @@
import numpy as np
import matplotlib.pyplot as plt
from scipy.stats import norm
import tensorflow as tf
import tensorflow.compat.v1 as tf

import tflearn

Expand Down
2 changes: 1 addition & 1 deletion examples/nlp/cnn_sentence_classification.py
Expand Up @@ -18,7 +18,7 @@
"""
from __future__ import division, print_function, absolute_import

import tensorflow as tf
import tensorflow.compat.v1 as tf
import tflearn
from tflearn.layers.core import input_data, dropout, fully_connected
from tflearn.layers.conv import conv_1d, global_max_pool
Expand Down
2 changes: 1 addition & 1 deletion examples/nlp/seq2seq_example.py
Expand Up @@ -12,7 +12,7 @@
import json

import numpy as np
import tensorflow as tf
import tensorflow.compat.v1 as tf

from tensorflow.contrib.legacy_seq2seq.python.ops import seq2seq
from tensorflow.python.ops import rnn_cell
Expand Down
4 changes: 2 additions & 2 deletions examples/notebooks/spiral.ipynb
Expand Up @@ -106,7 +106,7 @@
],
"source": [
"# train a linear classifier\n",
"import tensorflow as tf\n",
"import tensorflow.compat.v1 as tf\n",
"import tflearn\n",
"from tflearn.data_utils import to_categorical\n",
"\n",
Expand Down Expand Up @@ -183,7 +183,7 @@
],
"source": [
"# train a 2-layer neural network\n",
"import tensorflow as tf\n",
"import tensorflow.compat.v1 as tf\n",
"import tflearn\n",
"from tflearn.data_utils import to_categorical\n",
"\n",
Expand Down
2 changes: 1 addition & 1 deletion examples/others/recommender_wide_and_deep.py
Expand Up @@ -29,7 +29,7 @@

import numpy as np
import pandas as pd
import tensorflow as tf
import tensorflow.compat.v1 as tf

#-----------------------------------------------------------------------------

Expand Down
2 changes: 1 addition & 1 deletion examples/reinforcement_learning/atari_1step_qlearning.py
Expand Up @@ -31,7 +31,7 @@
from collections import deque

import gym
import tensorflow as tf
import tensorflow.compat.v1 as tf
import tflearn

# Fix for TF 0.12
Expand Down
4 changes: 2 additions & 2 deletions setup.py
Expand Up @@ -27,13 +27,13 @@ def run_tests(self):


setup(name='tflearn',
version='0.3.2',
version='0.4.0',
description='Deep Learning Library featuring a higher-level API for '
'TensorFlow',
author='TFLearn contributors',
author_email='aymeric.damien@gmail.com',
url='https://github.com/tflearn/tflearn',
download_url='https://github.com/tflearn/tflearn/tarball/0.3.2',
download_url='https://github.com/tflearn/tflearn/tarball/0.4.0',
license='MIT',
packages=find_packages(exclude=['tests*']),
install_requires=[
Expand Down
2 changes: 1 addition & 1 deletion tests/test.py
Expand Up @@ -2,7 +2,7 @@
This file contains test cases for tflearn
'''

import tensorflow as tf
import tensorflow.compat.v1 as tf
import tflearn
import unittest

Expand Down
2 changes: 1 addition & 1 deletion tests/test_helpers.py
@@ -1,4 +1,4 @@
import tensorflow as tf
import tensorflow.compat.v1 as tf
import tflearn
import unittest
import os
Expand Down
2 changes: 1 addition & 1 deletion tests/test_inputs.py
Expand Up @@ -2,7 +2,7 @@
This file contains test cases for tflearn
'''

import tensorflow as tf
import tensorflow.compat.v1 as tf
import tflearn
import unittest

Expand Down
2 changes: 1 addition & 1 deletion tests/test_layers.py
@@ -1,4 +1,4 @@
import tensorflow as tf
import tensorflow.compat.v1 as tf
import tflearn
import unittest
import os
Expand Down
2 changes: 1 addition & 1 deletion tests/test_metrics.py
Expand Up @@ -2,7 +2,7 @@
import unittest

import numpy as np
import tensorflow as tf
import tensorflow.compat.v1 as tf

class TestMetrics(unittest.TestCase):
"""
Expand Down
2 changes: 1 addition & 1 deletion tests/test_models.py
@@ -1,4 +1,4 @@
import tensorflow as tf
import tensorflow.compat.v1 as tf
import numpy as np
import tflearn
import unittest
Expand Down
2 changes: 1 addition & 1 deletion tests/test_models_loading_scope.py
@@ -1,4 +1,4 @@
import tensorflow as tf
import tensorflow.compat.v1 as tf
import tflearn
import unittest
import os
Expand Down
2 changes: 1 addition & 1 deletion tests/test_objectives.py
Expand Up @@ -2,7 +2,7 @@
import unittest

import numpy as np
import tensorflow as tf
import tensorflow.compat.v1 as tf


class TestObjectives(unittest.TestCase):
Expand Down
2 changes: 1 addition & 1 deletion tests/test_validation_monitors.py
@@ -1,6 +1,6 @@
from __future__ import division, print_function, absolute_import

import tensorflow as tf
import tensorflow.compat.v1 as tf
import tflearn
import unittest
import os
Expand Down
4 changes: 4 additions & 0 deletions tflearn/__init__.py
@@ -1,5 +1,9 @@
from __future__ import absolute_import

# Disable TF eager mode
import tensorflow.compat.v1 as tf
tf.disable_v2_behavior()

# Config
from . import config
from .config import is_training, get_training_mode, init_graph
Expand Down
2 changes: 1 addition & 1 deletion tflearn/activations.py
@@ -1,7 +1,7 @@
# -*- coding: utf-8 -*-
from __future__ import division, print_function, absolute_import

import tensorflow as tf
import tensorflow.compat.v1 as tf

import numpy as np
import tflearn
Expand Down
2 changes: 1 addition & 1 deletion tflearn/collections.py
@@ -1,7 +1,7 @@
# -*- coding: utf-8 -*-
from __future__ import division, print_function, absolute_import

import tensorflow as tf
import tensorflow.compat.v1 as tf

"""
For handling networks and keep tracks of important parameters, TFLearn is
Expand Down
2 changes: 1 addition & 1 deletion tflearn/config.py
@@ -1,6 +1,6 @@
from __future__ import division, print_function, absolute_import

import tensorflow as tf
import tensorflow.compat.v1 as tf

from .variables import variable

Expand Down
2 changes: 1 addition & 1 deletion tflearn/data_flow.py
Expand Up @@ -10,7 +10,7 @@
# Python 3
import queue

import tensorflow as tf
import tensorflow.compat.v1 as tf
from . import utils


Expand Down
2 changes: 1 addition & 1 deletion tflearn/data_preprocessing.py
Expand Up @@ -3,7 +3,7 @@

import numpy as np
import pickle
import tensorflow as tf
import tensorflow.compat.v1 as tf

_EPSILON = 1e-8

Expand Down
2 changes: 1 addition & 1 deletion tflearn/data_utils.py
Expand Up @@ -8,7 +8,7 @@
import pickle
import csv
import warnings
import tensorflow as tf
import tensorflow.compat.v1 as tf
try: #py3
from urllib.parse import urlparse
from urllib import request
Expand Down
2 changes: 1 addition & 1 deletion tflearn/datasets/imdb.py
Expand Up @@ -9,7 +9,7 @@
import os

import numpy
import tensorflow as tf
import tensorflow.compat.v1 as tf

def prepare_data(seqs, labels, maxlen=None):
"""Create the matrices from the datasets.
Expand Down
2 changes: 1 addition & 1 deletion tflearn/distances.py
Expand Up @@ -2,7 +2,7 @@

from __future__ import division, print_function, absolute_import

import tensorflow as tf
import tensorflow.compat.v1 as tf

from .utils import get_from_module

Expand Down
2 changes: 1 addition & 1 deletion tflearn/estimators/base.py
@@ -1,7 +1,7 @@
from __future__ import division, print_function, absolute_import

import os
import tensorflow as tf
import tensorflow.compat.v1 as tf
from tensorflow.python.ops import resources

from ..utils import validate_func
Expand Down
2 changes: 1 addition & 1 deletion tflearn/estimators/cluster/kmeans.py
Expand Up @@ -6,7 +6,7 @@
import numpy as np
import time

import tensorflow as tf
import tensorflow.compat.v1 as tf
from tensorflow.contrib.factorization.python.ops import clustering_ops as c_ops
from tensorflow.contrib.tensor_forest.python.ops import data_ops
from tensorflow.python.ops import state_ops, array_ops, math_ops
Expand Down
2 changes: 1 addition & 1 deletion tflearn/estimators/ensemble/forest.py
Expand Up @@ -6,7 +6,7 @@
import numpy as np
import time

import tensorflow as tf
import tensorflow.compat.v1 as tf
from tensorflow.contrib.tensor_forest.python import tensor_forest
from tensorflow.contrib.tensor_forest.python.ops import data_ops
from tensorflow.python.ops import state_ops, array_ops, math_ops
Expand Down
2 changes: 1 addition & 1 deletion tflearn/helpers/evaluator.py
@@ -1,6 +1,6 @@
from __future__ import division, print_function, absolute_import

import tensorflow as tf
import tensorflow.compat.v1 as tf

import tflearn
from ..utils import to_list
Expand Down

0 comments on commit 6e38143

Please sign in to comment.