Hi,
When I run the code, the following error occurs:
File "/geode2/projects/iu/IN-REGI-PDM/Schizophrenia/Schizophrenia-Workspace/Devon-Shuo/Processed_Data/MED-BERT/Code/run_EHRpretraining_QA2Seq.py", line 121, in model_fn
for name in sorted(features.keys()):
File "/N/soft/rhel7/python/3.9.8/lib/python3.9/site-packages/tensorflow/python/framework/ops.py", line 442, in getattr
self.getattribute(name)
AttributeError: 'Tensor' object has no attribute 'keys'
I have added these two lines of code in order to fix the versioning issue:
import tensorflow.compat.v1 as tf
tf.disable_v2_behavior()
How can I solve this? Thank you very much!
Hi, When I run the code, the following error occurs: File "/geode2/projects/iu/IN-REGI-PDM/Schizophrenia/Schizophrenia-Workspace/Devon-Shuo/Processed_Data/MED-BERT/Code/run_EHRpretraining_QA2Seq.py", line 121, in model_fn for name in sorted(features.keys()): File "/N/soft/rhel7/python/3.9.8/lib/python3.9/site-packages/tensorflow/python/framework/ops.py", line 442, in getattr self.getattribute(name) AttributeError: 'Tensor' object has no attribute 'keys'
I have added these two lines of code in order to fix the versioning issue: import tensorflow.compat.v1 as tf tf.disable_v2_behavior() How can I solve this? Thank you very much!