ZhiGroup / Med-BERT

Med-BERT, contextualized embedding model for structured EHR data
Apache License 2.0
260 stars 63 forks source link

run_EHRpretraining_QA2Seq #11

Open lishuo-0 opened 1 year ago

lishuo-0 commented 1 year ago

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!