#π Anaconda can't built-in environment "tf-gpu"
77 messages Β· Page 1 of 1 (latest)
@steel elk
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.
Now, add more details for those who might try to help you. What have you tried to do to upgrade tensorflow?
I just did a quick internet search. Did you try to upgrade via pip?
pip install tensorflow --upgrade
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?
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.
I've never used tensorflow, I can't answer that.
cool it updated the other but tensorflow
lemme try in pycharm if it could run the test code
oh ye of course
Well, I recommend reading the docs. π
@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
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)```
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.
oh for freak sake
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
i meant in the other environment it working fine
okay give me the code
still the same
or because it is cpu version?
i downloaded cpu version on python 3.11
import tensorflow as tf
print(tf.version)
make sure bro the problem is in set
should use the version : TensorFlow 2.x
huh
Try to reinstall it
It appears that the module is not defined on Pycharm
i'm arabic so I understand your words to an average degree
yup
ye i did
what does
import tensorflow as tf
print(tf.__file__)
``` say?
when ever i run it
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?
Anaconda not much benefit (none at all really)
bruh
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.