#πŸ”’ Anaconda can't built-in environment "tf-gpu"

77 messages Β· Page 1 of 1 (latest)

steel elk
#

Hi after i installed anaconda
they gave me a tf-gpu with python 3.9.18 and tensorflow 2.6.0
i cant update tensorflow in that environment

humble pelicanBOT
#

@steel elk

Python help channel opened

Remember to:

  • Ask your Python question, not if you can ask or if there's an expert who can help.
  • Show a code sample as text (rather than a screenshot) and the error message, if you've got one.
  • Explain what you expect to happen and what actually happens.

:warning: Do not pip install anything that isn't related to your question, especially if asked to over DMs.

steel elk
marble marsh
#

Now, add more details for those who might try to help you. What have you tried to do to upgrade tensorflow?

steel elk
marble marsh
#

I just did a quick internet search. Did you try to upgrade via pip?

#

pip install tensorflow --upgrade

steel elk
#

i tried pip install --upgrade tensorflow-gpu and it failed

#

im trying your

#

look like it is downloading

#

can i use both cpu and gpu version?

marble marsh
#

Again, I have no experience with anaconda. I'm sure enough people have had this kind of issue that a solution is somewhere on the internet.

marble marsh
steel elk
#

cool it updated the other but tensorflow

#

lemme try in pycharm if it could run the test code

#

oh ye of course

marble marsh
#

You did this?

#

conda create -n tf-gpu tensorflow-gpu
conda activate tf-gpu

steel elk
#

no i didnt

#

they created it after i downloaded anaconda

marble marsh
#

Well, I recommend reading the docs. πŸ‘

polar rock
#

@marble marsh okay

#

if you want to use version conda install -c conda-forge cudatoolkit=11.2 cudnn=8.1.0

#

@steel elk give me the code

steel elk
#

os.environ['TF_ENABLE_ONEDNN_OPTS'] = '0'

import tensorflow as tf
mnist = tf.keras.datasets.mnist

(x_train, y_train),(x_test, y_test) = mnist.load_data()
x_train, x_test = x_train / 255.0, x_test / 255.0

model = tf.keras.models.Sequential([
  tf.keras.layers.Flatten(input_shape=(28, 28)),
  tf.keras.layers.Dense(128, activation='relu'),
  tf.keras.layers.Dropout(0.2),
  tf.keras.layers.Dense(10, activation='softmax')
])

model.compile(optimizer='adam',
  loss='sparse_categorical_crossentropy',
  metrics=['accuracy'])

model.fit(x_train, y_train, epochs=5)
model.evaluate(x_test, y_test)```
humble pelicanBOT
#

Hey @steel elk!

It looks like you pasted Python code without syntax highlighting.

Please use syntax highlighting to improve the legibility of your code and make it easier for us to help you.

To do this, use the following method:
```py
print('Hello, world!')
```

This will result in the following:

print('Hello, world!')```
You can **edit your original message** to correct your code block.
steel elk
#

oh for freak sake

polar rock
#

from tensorflow import keras

#

@steel elk u should check the model if it set or not

#

or check pip show tensorflow TensorFlow 2.x should have tensorflow.keras

steel elk
#

i meant in the other environment it working fine

polar rock
steel elk
#

or because it is cpu version?

#

i downloaded cpu version on python 3.11

steel elk
polar rock
#

import tensorflow as tf
print(tf.version)

#

make sure bro the problem is in set

#

should use the version : TensorFlow 2.x

steel elk
#

oh wait a second

#

look like pycharm didnt understand

#

even version cant use

polar rock
steel elk
#

uhhh idk im downloaded pycharm tho

#

or we freaked

#

not pycharm problem

polar rock
steel elk
#

huh

polar rock
#

Try to reinstall it

steel elk
#

installed

#

but it still

#

kinda weird

polar rock
#

It appears that the module is not defined on Pycharm

steel elk
#

but i installed in environment

#

pip install tensorflow right?

polar rock
#

i'm arabic so I understand your words to an average degree

polar rock
steel elk
#

ye i did

cobalt yacht
#

what does

import tensorflow as tf
print(tf.__file__)
``` say?
steel elk
#

that is weird

#

none

#

are we freaked

#

forget about it

#

what is anaconda benefit

steel elk
#

it appear
2024-08-31 17:44:43.400942: I tensorflow/core/util/port.cc:153] oneDNN custom operations are on. You may see slightly different numerical results due to floating-point round-off errors from different computation orders. To turn them off, set the environment variable `TF_ENABLE_ONEDNN_OPTS=0`. 2024-08-31 17:44:43.934679: I tensorflow/core/util/port.cc:153] oneDNN custom operations are on. You may see slightly different numerical results due to floating-point round-off errors from different computation orders. To turn them off, set the environment variable `TF_ENABLE_ONEDNN_OPTS=0`. D:\PycharmProjects\pythonTest\.venv\Lib\site-packages\keras\src\layers\reshaping\flatten.py:37: UserWarning: Do not pass an `input_shape`/`input_dim` argument to a layer. When using Sequential models, prefer using an `Input(shape)` object as the first layer in the model instead. super().__init__(**kwargs) 2024-08-31 17:44:45.098288: I tensorflow/core/platform/cpu_feature_guard.cc:210] This TensorFlow binary is optimized to use available CPU instructions in performance-critical operations. To enable the following instructions: AVX2 AVX_VNNI FMA, in other operations, rebuild TensorFlow with the appropriate compiler flags.

#

does it harmful?

broken swallow
steel elk
#

bruh

humble pelicanBOT
#
Python help channel closed

This help channel has been closed and it's no longer possible to send messages here. If your question wasn't answered, feel free to create a new post in #1035199133436354600. To maximize your chances of getting a response, check out this guide on asking good questions.