Git Product home page Git Product logo

Comments (5)

aymericdamien avatar aymericdamien commented on June 12, 2024 1

Can you please try with the latest TFLearn version? tflearn 0.5.0 should support latest tensorflow. To update:
pip install tflearn --upgrade
but note that latest tflearn supports tf.compat.v1 api only.

from tflearn.

AnthonyTheKoala avatar AnthonyTheKoala commented on June 12, 2024 1

Dear Aymeric,
Thank you for your reply.
I successfully pipped tflearn, successfully instantianted tflearn in the IDLE program. and tried the example at https://github.com/tflearn/tflearn/blob/master/examples/basics/linear_regression.py successfully.

X = [3.3,4.4,5.5,6.71,6.93,4.168,9.779,6.182,7.59,2.167,7.042,10.791,5.313,7.997,5.654,9.27,3.1]
Y = [1.7,2.76,2.09,3.19,1.694,1.573,3.366,2.596,2.53,1.221,2.827,3.465,1.65,2.904,2.42,2.94,1.3]
input_ = tflearn.input_data(shape=[None])
linear = tflearn.single_unit(input_)
regression = tflearn.regression(linear, optimizer='sgd', loss='mean_square',  metric='R2', learning_rate=0.01)
m = tflearn.DNN(regression)
m.fit(X, Y, n_epoch=1000, show_metric=True, snapshot_epoch=False)
#After the 1000th iteration
print("Y = " + str(m.get_weights(linear.W)) +
      "*X + " + str(m.get_weights(linear.b)))
Y = [0.26903194]*X + [0.67546433]
print(m.predict([3.2, 3.3, 3.4]))
[1.5363666 1.5632697 1.590173 ]

Three questions please:
(1)
When I instantiated the code - what were the meaning of the warnings -

Python 3.8.6 (tags/v3.8.6:db45529, Sep 23 2020, 15:52:53) [MSC v.1927 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license()" for more information.
>>> import tflearn
WARNING:tensorflow:From c:\python38\lib\site-packages\tensorflow\python\compat\v2_compat.py:96: disable_resource_variables (from tensorflow.python.ops.variable_scope) is deprecated and will be removed in a future version.
Instructions for updating:
non-resource variables are not supported in the long term
curses is not supported on this machine (please install/reinstall curses for an optimal experience)

(2) In your remark , "the latest tflearn support tf.compatible v1 api only",
My version of Tensorflow is

import tensorflow as tf
tf.__version__
'2.3.0'

I understand that tf will only handle functions/methods/variables up to tf v1?
In other words, when using tf, will I have to implement this code

import tflearn
import tensorflow.compat.v1 as tf

(3) My version of tf does not cater for CUDA. I will be installing CUDA then tf for CUDA soon. Are there any issues to be careful when learning about tflearn? In addition will tflearn have those capabilities described at http://tflearn.org/examples/

Many thanks,
非常感謝 (using google translate)
Anthony of Sydney

from tflearn.

AnthonyTheKoala avatar AnthonyTheKoala commented on June 12, 2024

I am also having a similar problem.
I installed tflearn

c:\Python38>pip install tflearn --upgrade
Requirement already up-to-date: tflearn in c:\python38\lib\site-packages (0.3.2)

Requirement already satisfied, skipping upgrade: numpy in c:\python38\lib\site-p
ackages (from tflearn) (1.19.2)
Requirement already satisfied, skipping upgrade: six in c:\users\a\appdata\roami
ng\python\python38\site-packages (from tflearn) (1.15.0)
Requirement already satisfied, skipping upgrade: Pillow in c:\python38\lib\site-
packages (from tflearn) (7.2.0)

Attempting to instantiate tflearn in my IDLE environment

Python 3.8.6 (tags/v3.8.6:db45529, Sep 23 2020, 15:52:53) [MSC v.1927 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license()" for more information.
>>> import tflearn
Traceback (most recent call last):
  File "", line 1, in 
    import tflearn
  File "c:\python38\lib\site-packages\tflearn\__init__.py", line 4, in 
    from . import config
  File "c:\python38\lib\site-packages\tflearn\config.py", line 5, in 
    from .variables import variable
  File "c:\python38\lib\site-packages\tflearn\variables.py", line 7, in 
    from tensorflow.contrib.framework.python.ops import add_arg_scope as contrib_add_arg_scope
ModuleNotFoundError: No module named 'tensorflow.contrib'
>>> import tensorflow as tf
>>> tf.__version__
'2.3.0'

Other information:
OS: Win 7
Python: v3.8.6 64-bit
tensorflow: v2.3.0 which is > 1.4 according to the tflearn
numpy: v1.19.2
scipy: 1.5.3

Thank you,
Anthony of Sydney

from tflearn.

aymericdamien avatar aymericdamien commented on June 12, 2024

(1) You can ignore the warnings for now, I believe first one is due to initializing TF resources initialize_resources op (that are not directly use by tflearn, but may be useful if you use them in some custom code). And the curse warning is about terminal display.

(2) Yes, you will have to use import tensorflow.compat.v1 as tf instead (graph API approach). TF v2 adopted the 'eager api' that makes it more pythonic, but performance wise it is not as good as graph (even though there is a tf.function to wrap your code and execute it as graph).

(3) Yes, CUDA and the examples should be working too with latest version.

from tflearn.

AnthonyTheKoala avatar AnthonyTheKoala commented on June 12, 2024

Dear Aymeric,
Thank you for your kind response.
Thank you for your information regarding CUDA - this will be useful when I update laptop/PC which has a compute speed >= 3. which is a necessary requirement for tf.
My currrent NVidia's GPU only has a compute factor of 2.1, so tf won't work on the current GPU.

Again, thank you,
Anthony of Sydney

from tflearn.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.