MicrosoftDocs / windows-ai-docs

Windows AI docs
Creative Commons Attribution 4.0 International
13 stars 35 forks source link

[tensorflow-directml] With the latest version of tensorflow-cpu, errors occur and it does not work properly. #84

Closed shokoban closed 1 week ago

shokoban commented 1 year ago

[Enter feedback here]

page

checked date

comments

in STEP 4: Install base TensorFlow

The command in the current documentation downloads sensorflow==2.10.0. However, when I install the directml plugin into this version, it does not run wll. It will give error messages such as "relu function not implemented. Therefore, it was necessary to specify the version as follows.

pip install tensorflow-cpu==2.9.0

cofirmation environment

use trained model

model_vgg16 = tf.keras.applications.vgg16.VGG16(include_top=False, pooling='avg')

model = keras.Sequential() model.add(model_vgg16) model.add(Dense(128, activation="relu")) model.add(Dense(8, activation="softmax"))

model.compile(loss='categorical_crossentropy', optimizer=keras.optimizers.SGD(lr=1e-3, decay=1e-6, momentum=0.9, nesterov=True), metrics=['accuracy'])



---
#### Document Details

⚠ *Do not edit this section. It is required for learn.microsoft.com ➟ GitHub issue linking.*

* ID: 764f2adc-3018-9307-941b-1e37a0ced157
* Version Independent ID: 764f2adc-3018-9307-941b-1e37a0ced157
* Content: [DirectML Plugin for TensorFlow 2](https://learn.microsoft.com/en-us/windows/ai/directml/gpu-tensorflow-plugin?source=recommendations#feedback)
* Content Source: [docs/directml/gpu-tensorflow-plugin.md](https://github.com/MicrosoftDocs/windows-ai-docs/blob/docs/docs/directml/gpu-tensorflow-plugin.md)
* Product: **machine-learning**
* GitHub Login: @stevewhims
* Microsoft Alias: **jdykhuizen**
rjdyk commented 1 year ago

Thanks for trying out TensorFlow-DirectML-Plugin! Can you confirm that you are running the command pip install tensorflow-cpu and not pip install tensorflow. Unfortunately our plugin only supports the cpu version of TensorFlow at this time.

shokoban commented 1 year ago

Yes, I was running the command "pip install tensorflow-cpu" and not "pip install tensorflow". I have understand that TensorFlow-DirectML-Plugin only supports the cpu version of TensorFlow. Because I should have found it written in the manual in step4. (Out of curiosity, I have tried "pip install tensorflow", but as you say, I have confirmed that it does not work.)

stevewhims commented 1 week ago

Just an update: this issue is on the product team subject-matter experts' radar. They have all the info from this thread. So I'll go ahead and close this issue until such time as they have the bandwidth to address it.

-Steve