Its Strange , now I am getting another error , I didn’t change anything
Please let me know why this exception is coming because of below mentioned syntax
def process_tfr(filepath, data_dir):

process a Waymo tf record into a tf api tf record


args:
- filepath [str]: path to the Waymo tf record file
- data_dir [str]: path to the destination directory
 # create processed data dir

dest = os.path.join(data_dir, ‘processed’)
os.makedirs(dest, exist_ok=True)
file_name = os.path.basename(filepath)
if os.path.exists(f’{dest}/{file_name}’):
return
logger.info(f’Processing {filepath}’)
writer = tf.python_io.TFRecordWriter(f’{dest}/{file_name}’)
dataset = tf.data.TFRecordDataset(filepath, compression_type=’’)
for idx, data in enumerate(dataset):


(pid=138) Instructions for updating:
(pid=138) non-resource variables are not supported in the long term
(pid=100) WARNING:tensorflow:From /usr/local/lib/python3.8/dist-packages/tensorflow/python/compat/v2_compat.py:101: disable_resource_variables (from tensorflow.python.ops.variable_scope) is deprecated and will be removed in a future version.
(pid=100) Instructions for updating:
(pid=100) non-resource variables are not supported in the long term
(pid=250) 2021-11-10 07:39:15,977 INFO     Processing /app/project/training_0000/raw/segment-10017090168044687777_6380_000_6400_000_with_camera_labels.tfrecord
Traceback (most recent call last):
File “download_process.py”, line 204, in 
_ = ray.get(workers)
File “/usr/local/lib/python3.8/dist-packages/ray/worker.py”, line 1538, in get
raise value.as_instanceof_cause()
ray.exceptions.RayTaskError(RuntimeError): ray::main.download_and_process() (pid=250, ip=172.17.0.2)
File “python/ray/_raylet.pyx”, line 479, in ray._raylet.execute_task
File “download_process.py”, line 176, in download_and_process
process_tfr(local_path, data_dir)
File “download_process.py”, line 137, in process_tfr
iterator = iter(dataset)
File “/usr/local/lib/python3.8/dist-packages/tensorflow/python/data/ops/dataset_ops.py”, line 3445, in iter
return iter(self._dataset)
File “/usr/local/lib/python3.8/dist-packages/tensorflow/python/data/ops/dataset_ops.py”, line 413, in iter
raise RuntimeError("iter() is only supported inside of tf.function "
RuntimeError: iter() is only supported inside of tf.function or when eager execution is enabled.