Open rafaleo opened 4 years ago
do u have solve it? I meet the same error
no. not yet.
30 Nis 2020 Per 05:49 tarihinde banayoyo notifications@github.com şunu yazdı:
do u have solve it? I meet the same error
— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/Lsdefine/attention-is-all-you-need-keras/issues/35#issuecomment-621581123, or unsubscribe https://github.com/notifications/unsubscribe-auth/AJCO3UTUC6DCCK6JFDUCP3TRPDRNBANCNFSM4LFUNUVQ .
do u have solve it? I meet the same error
do you solve the error,I have the same problem
E:\ProgramData\Anaconda3\envs\Dlearning\python.exe F:/reaserch/Dlearning/attention-is-all-you-need-keras-master/pinyin_main.py
2021-11-02 11:35:20.786849: I tensorflow/stream_executor/platform/default/dso_loader.cc:48] Successfully opened dynamic library cudart64_101.dll
loading data/pinyin_word.txt
seq 1 words: 198
seq 2 words: 218
2021-11-02 11:35:22.790685: I tensorflow/stream_executor/platform/default/dso_loader.cc:48] Successfully opened dynamic library nvcuda.dll
2021-11-02 11:35:22.822934: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1716] Found device 0 with properties:
pciBusID: 0000:01:00.0 name: GeForce RTX 2070 Super computeCapability: 7.5
coreClock: 1.38GHz coreCount: 40 deviceMemorySize: 8.00GiB deviceMemoryBandwidth: 417.29GiB/s
2021-11-02 11:35:22.823133: I tensorflow/stream_executor/platform/default/dso_loader.cc:48] Successfully opened dynamic library cudart64_101.dll
2021-11-02 11:35:22.826677: I tensorflow/stream_executor/platform/default/dso_loader.cc:48] Successfully opened dynamic library cublas64_10.dll
2021-11-02 11:35:22.829716: I tensorflow/stream_executor/platform/default/dso_loader.cc:48] Successfully opened dynamic library cufft64_10.dll
2021-11-02 11:35:22.831096: I tensorflow/stream_executor/platform/default/dso_loader.cc:48] Successfully opened dynamic library curand64_10.dll
2021-11-02 11:35:22.834603: I tensorflow/stream_executor/platform/default/dso_loader.cc:48] Successfully opened dynamic library cusolver64_10.dll
2021-11-02 11:35:22.836756: I tensorflow/stream_executor/platform/default/dso_loader.cc:48] Successfully opened dynamic library cusparse64_10.dll
2021-11-02 11:35:22.843372: I tensorflow/stream_executor/platform/default/dso_loader.cc:48] Successfully opened dynamic library cudnn64_7.dll
2021-11-02 11:35:22.843524: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1858] Adding visible gpu devices: 0
2021-11-02 11:35:22.843780: I tensorflow/core/platform/cpu_feature_guard.cc:142] This TensorFlow binary is optimized with oneAPI Deep Neural Network Library (oneDNN)to use the following CPU instructions in performance-critical operations: AVX2
To enable them in other operations, rebuild TensorFlow with the appropriate compiler flags.
2021-11-02 11:35:22.850462: I tensorflow/compiler/xla/service/service.cc:168] XLA service 0x296289b0a10 initialized for platform Host (this does not guarantee that XLA will be used). Devices:
2021-11-02 11:35:22.850703: I tensorflow/compiler/xla/service/service.cc:176] StreamExecutor device (0): Host, Default Version
2021-11-02 11:35:22.850868: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1716] Found device 0 with properties:
pciBusID: 0000:01:00.0 name: GeForce RTX 2070 Super computeCapability: 7.5
coreClock: 1.38GHz coreCount: 40 deviceMemorySize: 8.00GiB deviceMemoryBandwidth: 417.29GiB/s
2021-11-02 11:35:22.851063: I tensorflow/stream_executor/platform/default/dso_loader.cc:48] Successfully opened dynamic library cudart64_101.dll
2021-11-02 11:35:22.851157: I tensorflow/stream_executor/platform/default/dso_loader.cc:48] Successfully opened dynamic library cublas64_10.dll
2021-11-02 11:35:22.851249: I tensorflow/stream_executor/platform/default/dso_loader.cc:48] Successfully opened dynamic library cufft64_10.dll
2021-11-02 11:35:22.851343: I tensorflow/stream_executor/platform/default/dso_loader.cc:48] Successfully opened dynamic library curand64_10.dll
2021-11-02 11:35:22.851436: I tensorflow/stream_executor/platform/default/dso_loader.cc:48] Successfully opened dynamic library cusolver64_10.dll
2021-11-02 11:35:22.851529: I tensorflow/stream_executor/platform/default/dso_loader.cc:48] Successfully opened dynamic library cusparse64_10.dll
2021-11-02 11:35:22.851621: I tensorflow/stream_executor/platform/default/dso_loader.cc:48] Successfully opened dynamic library cudnn64_7.dll
2021-11-02 11:35:22.851731: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1858] Adding visible gpu devices: 0
2021-11-02 11:35:23.321532: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1257] Device interconnect StreamExecutor with strength 1 edge matrix:
2021-11-02 11:35:23.321709: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1263] 0
2021-11-02 11:35:23.321789: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1276] 0: N
2021-11-02 11:35:23.321964: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1402] Created TensorFlow device (/job:localhost/replica:0/task:0/device:GPU:0 with 6613 MB memory) -> physical GPU (device: 0, name: GeForce RTX 2070 Super, pci bus id: 0000:01:00.0, compute capability: 7.5)
2021-11-02 11:35:23.324097: I tensorflow/compiler/xla/service/service.cc:168] XLA service 0x2964d88f920 initialized for platform CUDA (this does not guarantee that XLA will be used). Devices:
2021-11-02 11:35:23.324220: I tensorflow/compiler/xla/service/service.cc:176] StreamExecutor device (0): GeForce RTX 2070 Super, Compute Capability 7.5
Traceback (most recent call last):
File "F:/reaserch/Dlearning/attention-is-all-you-need-keras-master/pinyin_main.py", line 23, in tf.Tensor
as a Python bool
")
File "E:\ProgramData\Anaconda3\envs\Dlearning\lib\site-packages\tensorflow\python\framework\ops.py", line 479, in _disallow_in_graph_mode
" this function with @tf.function.".format(task))
tensorflow.python.framework.errors_impl.OperatorNotAllowedInGraphError: using a tf.Tensor
as a Python bool
is not allowed in Graph execution. Use Eager execution or decorate this function with @tf.function.
I have the same error
I can run the code in tf=2.6.0. Please provide the environments.
Or using a lambda layer to package the tf function may help, like this: transformer.py 453-457
loss = Lambda(lambda x:get_loss(x[0], x[1]))([final_output, tgt_true])
self.ppl = K.exp(loss)
#self.accu = get_accu(final_output, tgt_true)
self.accu = Lambda(lambda x:get_accu(x[0], x[1]))([final_output, tgt_true])
This is also runable in my env.
I had the same problem but correct it by upgrading tensorflow to 2.7.0 :)
Hello. I try to evaluate your script and got the following error message:
I use keras 2+ and tf 2+ as well but not using any gpu.