Any ideas what this could be? Let me know if you need more info. Thanks.
WARNING:tensorflow:Entity <function ensure_index at 0x0000021F330CFE58> could not be transformed and will be executed as-is. Please report this to the AutoGraph team. When filing the bug, set the verbosity to 10 (on Linux, export AUTOGRAPH_VERBOSITY=10
) and attach the full output. Cause: LIVE_VARS_IN
WARNING: Entity <function ensure_index at 0x0000021F330CFE58> could not be transformed and will be executed as-is. Please report this to the AutoGraph team. When filing the bug, set the verbosity to 10 (on Linux, export AUTOGRAPH_VERBOSITY=10
) and attach the full output. Cause: LIVE_VARS_IN
NameError Traceback (most recent call last)
in
94
95 if name == "main":
---> 96 main()
97
98 # for p in sys.path:
in main()
29 list_ds = load_img_filenames_an_display_some("C:\Users\*******\OneDrive - ******* \Documents\******\cropped", 5)
30 # Set num_parallel_calls
so multiple images are loaded/processed in parallel.
---> 31 labeled_ds = list_ds.map(process_path, num_parallel_calls=None)
32 for image, label in labeled_ds.take(1):
33 print("Image shape: ", image.numpy().shape)
~\AppData\Local\Continuum\anaconda3\envs\tf\lib\site-packages\tensorflow_core\python\data\ops\dataset_ops.py in map(self, map_func, num_parallel_calls)
1898 if num_parallel_calls is None:
1899 return DatasetV1Adapter(
-> 1900 MapDataset(self, map_func, preserve_cardinality=False))
1901 else:
1902 return DatasetV1Adapter(
~\AppData\Local\Continuum\anaconda3\envs\tf\lib\site-packages\tensorflow_core\python\data\ops\dataset_ops.py in init(self, input_dataset, map_func, use_inter_op_parallelism, preserve_cardinality, use_legacy_function)
3414 self._transformation_name(),
3415 dataset=input_dataset,
-> 3416 use_legacy_function=use_legacy_function)
3417 variant_tensor = gen_dataset_ops.map_dataset(
3418 input_dataset._variant_tensor, # pylint: disable=protected-access
~\AppData\Local\Continuum\anaconda3\envs\tf\lib\site-packages\tensorflow_core\python\data\ops\dataset_ops.py in init(self, func, transformation_name, dataset, input_classes, input_shapes, input_types, input_structure, add_to_graph, use_legacy_function, defun_kwargs)
2693 resource_tracker = tracking.ResourceTracker()
2694 with tracking.resource_tracker_scope(resource_tracker):
-> 2695 self._function = wrapper_fn._get_concrete_function_internal()
2696 if add_to_graph:
2697 self._function.add_to_graph(ops.get_default_graph())
~\AppData\Local\Continuum\anaconda3\envs\tf\lib\site-packages\tensorflow_core\python\eager\function.py in _get_concrete_function_internal(self, *args, **kwargs)
1852 """Bypasses error checking when getting a graph function."""
1853 graph_function = self._get_concrete_function_internal_garbage_collected(
-> 1854 *args, **kwargs)
1855 # We're returning this concrete function to someone, and they may keep a
1856 # reference to the FuncGraph without keeping a reference to the
~\AppData\Local\Continuum\anaconda3\envs\tf\lib\site-packages\tensorflow_core\python\eager\function.py in _get_concrete_function_internal_garbage_collected(self, *args, **kwargs)
1846 if self.input_signature:
1847 args, kwargs = None, None
-> 1848 graph_function, _, _ = self._maybe_define_function(args, kwargs)
1849 return graph_function
1850
~\AppData\Local\Continuum\anaconda3\envs\tf\lib\site-packages\tensorflow_core\python\eager\function.py in _maybe_define_function(self, args, kwargs)
2148 graph_function = self._function_cache.primary.get(cache_key, None)
2149 if graph_function is None:
-> 2150 graph_function = self._create_graph_function(args, kwargs)
2151 self._function_cache.primary[cache_key] = graph_function
2152 return graph_function, args, kwargs
~\AppData\Local\Continuum\anaconda3\envs\tf\lib\site-packages\tensorflow_core\python\eager\function.py in _create_graph_function(self, args, kwargs, override_flat_arg_shapes)
2039 arg_names=arg_names,
2040 override_flat_arg_shapes=override_flat_arg_shapes,
-> 2041 capture_by_value=self._capture_by_value),
2042 self._function_attributes,
2043 # Tell the ConcreteFunction to clean up its graph once it goes out of
~\AppData\Local\Continuum\anaconda3\envs\tf\lib\site-packages\tensorflow_core\python\framework\func_graph.py in func_graph_from_py_func(name, python_func, args, kwargs, signature, func_graph, autograph, autograph_options, add_control_dependencies, arg_names, op_return_value, collections, capture_by_value, override_flat_arg_shapes)
913 converted_func)
914
--> 915 func_outputs = python_func(*func_args, **func_kwargs)
916
917 # invariant: func_outputs
contains only Tensors, CompositeTensors,
~\AppData\Local\Continuum\anaconda3\envs\tf\lib\site-packages\tensorflow_core\python\data\ops\dataset_ops.py in wrapper_fn(*args)
2687 attributes=defun_kwargs)
2688 def wrapper_fn(*args): # pylint: disable=missing-docstring
-> 2689 ret = _wrapper_helper(*args)
2690 ret = structure.to_tensor_list(self._output_structure, ret)
2691 return [ops.convert_to_tensor(t) for t in ret]
~\AppData\Local\Continuum\anaconda3\envs\tf\lib\site-packages\tensorflow_core\python\data\ops\dataset_ops.py in _wrapper_helper(*args)
2632 nested_args = (nested_args,)
2633
-> 2634 ret = autograph.tf_convert(func, ag_ctx)(*nested_args)
2635 # If func
returns a list of tensors, nest.flatten()
and
2636 # ops.convert_to_tensor()
would conspire to attempt to stack
~\AppData\Local\Continuum\anaconda3\envs\tf\lib\site-packages\tensorflow_core\python\autograph\impl\api.py in wrapper(*args, **kwargs)
235 except Exception as e: # pylint:disable=broad-except
236 if hasattr(e, 'ag_error_metadata'):
--> 237 raise e.ag_error_metadata.to_exception(e)
238 else:
239 raise
NameError: in converted code:
<ipython-input-1-6fa716029fe8>:77 process_path *
label = get_label(file_path)
<ipython-input-1-6fa716029fe8>:56 get_label *
df = load_and_clean_csv("C:\\Users\\*******\\OneDrive - ******* ********\\Documents\\**************\\Sample list.xlsx")
<ipython-input-1-6fa716029fe8>:47 load_and_clean_csv *
df = df.drop(["Unnamed: 5", "Unnamed: 6"], axis=1)
C:\Users\*********\AppData\Local\Continuum\anaconda3\envs\tf\lib\site-packages\pandas\core\frame.py:4110 drop *
return super().drop(
C:\Users\*********\AppData\Local\Continuum\anaconda3\envs\tf\lib\site-packages\pandas\core\generic.py:3914 drop *
obj = obj._drop_axis(labels, axis, level=level, errors=errors)
C:\Users\*********\AppData\Local\Continuum\anaconda3\envs\tf\lib\site-packages\pandas\core\generic.py:3947 _drop_axis *
result = self.reindex(**{axis_name: new_axis})
C:\Users\*********\AppData\Local\Continuum\anaconda3\envs\tf\lib\site-packages\pandas\util\_decorators.py:3959 wrapper *
return func(*args, **kwargs)
C:\Users\*********\AppData\Local\Continuum\anaconda3\envs\tf\lib\site-packages\pandas\core\frame.py:3976 reindex *
return super().reindex(**kwargs)
C:\Users\*********\AppData\Local\Continuum\anaconda3\envs\tf\lib\site-packages\pandas\core\generic.py:4513 reindex *
return self._reindex_axes(
C:\Users\*********\AppData\Local\Continuum\anaconda3\envs\tf\lib\site-packages\pandas\core\frame.py:3857 _reindex_axes *
frame = frame._reindex_columns(
C:\Users\*********\AppData\Local\Continuum\anaconda3\envs\tf\lib\site-packages\pandas\core\frame.py:3902 _reindex_columns *
return self._reindex_with_indexers(
C:\Users\*********\AppData\Local\Continuum\anaconda3\envs\tf\lib\site-packages\pandas\core\generic.py:4571 _reindex_with_indexers *
new_data = new_data.reindex_indexer(
C:\Users\*********\AppData\Local\Continuum\anaconda3\envs\tf\lib\site-packages\pandas\core\internals\managers.py:1257 reindex_indexer *
new_blocks = self._slice_take_blocks_ax0(indexer, fill_tuple=(fill_value,))
C:\Users\*********\AppData\Local\Continuum\anaconda3\envs\tf\lib\site-packages\pandas\core\internals\managers.py:1328 _slice_take_blocks_ax0 *
for blkno, mgr_locs in libinternals.get_blkno_placements(
C:\Users\*********\AppData\Local\Continuum\anaconda3\envs\tf\lib\site-packages\tensorflow_core\python\autograph\operators\control_flow.py:339 for_stmt
return _py_for_stmt(iter_, extra_test, body, get_state, set_state, init_vars)
C:\Users\*********\AppData\Local\Continuum\anaconda3\envs\tf\lib\site-packages\tensorflow_core\python\autograph\operators\control_flow.py:348 _py_for_stmt
if extra_test is not None and not extra_test(*state):
C:\Users\*********\AppData\Local\Temp\tmpip4vchrs.py:173 extra_test
return ag__.not_(do_return)
NameError: free variable 'do_return' referenced before assignment in enclosing scope