tensorflow / data-validation

Library for exploring and validating machine learning data

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Descriptor can not be created directly

Utsav4852 opened this issue · comments

I am trying to install tensorflow-data-validation and after successful installation, I have tried creating a new environment with Python 3.8|3.9. It worked once for me but after restarting the computer again it shows the same error.

It shows the below error each time:

Error

---> 3 import tensorflow_data_validation as tfdv

File c:\Users\Cobra.conda\envs\env\lib\site-packages\tensorflow_data_validation_init_.py:27
24 from tensorflow_data_validation.api.stats_api import WriteStatisticsToTFRecord
26 # Import validation API.
---> 27 from tensorflow_data_validation.api.validation_api import DetectFeatureSkew
28 from tensorflow_data_validation.api.validation_api import infer_schema
29 from tensorflow_data_validation.api.validation_api import update_schema

File c:\Users\Cobra.conda\envs\env\lib\site-packages\tensorflow_data_validation\api\validation_api.py:29
27 from tensorflow_data_validation import constants
28 from tensorflow_data_validation import types
---> 29 from tensorflow_data_validation.anomalies.proto import custom_validation_config_pb2
30 from tensorflow_data_validation.anomalies.proto import validation_config_pb2
31 from tensorflow_data_validation.anomalies.proto import validation_metadata_pb2

File c:\Users\Cobra.conda\envs\env\lib\site-packages\tensorflow_data_validation\anomalies\proto\custom_validation_config_pb2.py:39
15 from tensorflow_metadata.proto.v0 import path_pb2 as tensorflow__metadata_dot_proto_dot_v0_dot_path__pb2
18 DESCRIPTOR = _descriptor.FileDescriptor(
19 name='tensorflow_data_validation/anomalies/proto/custom_validation_config.proto',
20 package='tensorflow.data_validation',
(...)
25 ,
26 dependencies=[tensorflow__metadata_dot_proto_dot_v0_dot_anomalies__pb2.DESCRIPTOR,tensorflow__metadata_dot_proto_dot_v0_dot_path__pb2.DESCRIPTOR,])
31 _VALIDATION = _descriptor.Descriptor(
32 name='Validation',
33 full_name='tensorflow.data_validation.Validation',
34 filename=None,
35 file=DESCRIPTOR,
36 containing_type=None,
37 create_key=_descriptor._internal_create_key,
38 fields=[
---> 39 _descriptor.FieldDescriptor(
40 name='sql_expression', full_name='tensorflow.data_validation.Validation.sql_expression', index=0,
41 number=1, type=9, cpp_type=9, label=1,
42 has_default_value=False, default_value=b"".decode('utf-8'),
43 message_type=None, enum_type=None, containing_type=None,
44 is_extension=False, extension_scope=None,
45 serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key),
46 _descriptor.FieldDescriptor(
47 name='severity', full_name='tensorflow.data_validation.Validation.severity', index=1,
48 number=2, type=14, cpp_type=8, label=1,
49 has_default_value=False, default_value=0,
50 message_type=None, enum_type=None, containing_type=None,
51 is_extension=False, extension_scope=None,
52 serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key),
53 _descriptor.FieldDescriptor(
54 name='description', full_name='tensorflow.data_validation.Validation.description', index=2,
55 number=3, type=9, cpp_type=9, label=1,
56 has_default_value=False, default_value=b"".decode('utf-8'),
57 message_type=None, enum_type=None, containing_type=None,
58 is_extension=False, extension_scope=None,
59 serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key),
60 _descriptor.FieldDescriptor(
61 name='in_environment', full_name='tensorflow.data_validation.Validation.in_environment', index=3,
62 number=4, type=9, cpp_type=9, label=3,
63 has_default_value=False, default_value=[],
64 message_type=None, enum_type=None, containing_type=None,
65 is_extension=False, extension_scope=None,
66 serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key),
67 ],
68 extensions=[
69 ],
70 nested_types=[],
71 enum_types=[
72 ],
73 serialized_options=None,
74 is_extendable=False,
75 syntax='proto2',
76 extension_ranges=[],
77 oneofs=[
78 ],
79 serialized_start=193,
80 serialized_end=338,
81 )
84 _FEATUREVALIDATION = _descriptor.Descriptor(
85 name='FeatureValidation',
86 full_name='tensorflow.data_validation.FeatureValidation',
(...)
126 serialized_end=495,
127 )
130 _FEATUREPAIRVALIDATION = _descriptor.Descriptor(
131 name='FeaturePairValidation',
132 full_name='tensorflow.data_validation.FeaturePairValidation',
(...)
186 serialized_end=745,
187 )

File c:\Users\Cobra.conda\envs\env\lib\site-packages\google\protobuf\descriptor.py:561, in FieldDescriptor.new(cls, name, full_name, index, number, type, cpp_type, label, default_value, message_type, enum_type, containing_type, is_extension, extension_scope, options, serialized_options, has_default_value, containing_oneof, json_name, file, create_key)
555 def new(cls, name, full_name, index, number, type, cpp_type, label,
556 default_value, message_type, enum_type, containing_type,
557 is_extension, extension_scope, options=None,
558 serialized_options=None,
559 has_default_value=True, containing_oneof=None, json_name=None,
560 file=None, create_key=None): # pylint: disable=redefined-builtin
--> 561 _message.Message._CheckCalledFromGeneratedFile()
562 if is_extension:
563 return _message.default_pool.FindExtensionByName(full_name)

TypeError: Descriptors cannot not be created directly.
If this call came from a _pb2.py file, your generated code is out of date and must be regenerated with protoc >= 3.19.0.
If you cannot immediately regenerate your protos, some other possible workarounds are:

  1. Downgrade the protobuf package to 3.20.x or lower.
  2. Set PROTOCOL_BUFFERS_PYTHON_IMPLEMENTATION=python (but this will use pure-Python parsing and will be much slower).

More information: https://developers.google.com/protocol-buffers/docs/news/2022-05-06#python-updates