Kyubyong / transformer

A TensorFlow Implementation of the Transformer: Attention Is All You Need
Apache License 2.0
4.27k stars 1.3k forks source link

type object 'IteratorBase' has no attribute 'from_structure' #189

Open Fran0727 opened 2 months ago

Fran0727 commented 2 months ago

Is from_structure is not usable in TF2.X ? How can I solve it? I can't degrade TF2.X to 1.X

2024-08-20 16:10:54.724103: 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 FMA, in other operations, rebuild TensorFlow with the appropriate compiler flags. Traceback (most recent call last): File "E:\transformer-master-GE\transformer-master\train.py", line 39, in iter = tf.data.Iterator.from_structure(train_batches.output_types, train_batches.output_shapes) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ AttributeError: type object 'IteratorBase' has no attribute 'from_structure'

Fran0727 commented 2 months ago

I already run prepro.py, it seems ok. And this issue comes up when I try to run train.py