按照这个配置,除了tensorflow不是gpu版(已经能在pycharm上跑通),其他配置都一样,但是就是报错,报错在下面,有什么方法能解决吗?也试过把protobu版本换成3.6.1和3.6.0。还试过把keras和tensorflow卸载重装,但是都在jupyter上报这个错误,Python是3.6多的版本。
TypeError Traceback (most recent call last)
Input In [1], in <cell line: 8>()
5 sys.path.append('C:/Users/p'j'm/Desktop/A')
6 os.makedirs('results/train_out/', exist_ok=True)
----> 8 import keras.backend as K
9 from keras import layers
10 from keras.callbacks import TensorBoard
File ~\AppData\Roaming\Python\Python39\site-packages\keras_init_.py:3, in
1 from future import absolute_import
----> 3 from . import utils
4 from . import activations
5 from . import applications
File ~\AppData\Roaming\Python\Python39\site-packages\keras\utils_init_.py:6, in
4 from . import data_utils
5 from . import io_utils
----> 6 from . import conv_utils
8 # Globally-importable utils.
9 from .io_utils import HDF5Matrix
File ~\AppData\Roaming\Python\Python39\site-packages\keras\utils\conv_utils.py:9, in
7 from six.moves import range
8 import numpy as np
----> 9 from .. import backend as K
12 def normalize_tuple(value, n, name):
13 """Transforms a single int or iterable of ints into an int tuple.
14
15 # Arguments
(...)
27 passed.
28 """
File ~\AppData\Roaming\Python\Python39\site-packages\keras\backend_init_.py:84, in
82 elif _BACKEND == 'tensorflow':
83 sys.stderr.write('Using TensorFlow backend.\n')
---> 84 from .tensorflow_backend import *
85 else:
86 raise ValueError('Unknown backend: ' + str(_BACKEND))
File ~\AppData\Roaming\Python\Python39\site-packages\keras\backend\tensorflow_backend.py:5, in
2 from future import division
3 from future import print_function
----> 5 import tensorflow as tf
6 from tensorflow.python.training import moving_averages
7 from tensorflow.python.ops import tensor_array_ops
File ~\AppData\Roaming\Python\Python39\site-packages\tensorflow_init_.py:37, in
34 import sys as _sys
35 import typing as _typing
---> 37 from tensorflow.python.tools import module_util as _module_util
38 from tensorflow.python.util.lazy_loader import LazyLoader as _LazyLoader
40 # Make sure code inside the TensorFlow codebase can use tf2.enabled() at import.
File ~\AppData\Roaming\Python\Python39\site-packages\tensorflow\python_init_.py:37, in
29 # We aim to keep this file minimal and ideally remove completely.
30 # If you are adding a new file with @tf_export decorators,
31 # import it in modules_with_exports.py instead.
32
33 # go/tf-wildcard-import
34 # pylint: disable=wildcard-import,g-bad-import-order,g-import-not-at-top
36 from tensorflow.python import pywrap_tensorflow as _pywrap_tensorflow
---> 37 from tensorflow.python.eager import context
39 # pylint: enable=wildcard-import
40
41 # Bring in subpackages.
42 from tensorflow.python import data
File ~\AppData\Roaming\Python\Python39\site-packages\tensorflow\python\eager\context.py:28, in
25 from absl import logging
26 import numpy as np
---> 28 from tensorflow.core.framework import function_pb2
29 from tensorflow.core.protobuf import config_pb2
30 from tensorflow.core.protobuf import coordination_config_pb2
File ~\AppData\Roaming\Python\Python39\site-packages\tensorflow\core\framework\function_pb2.py:16, in
11 # @@protoc_insertion_point(imports)
13 _sym_db = _symbol_database.Default()
---> 16 from tensorflow.core.framework import attr_value_pb2 as tensorflow_dot_core_dot_framework_dot_attr__value__pb2
17 from tensorflow.core.framework import node_def_pb2 as tensorflow_dot_core_dot_framework_dot_node__def__pb2
18 from tensorflow.core.framework import op_def_pb2 as tensorflow_dot_core_dot_framework_dot_op__def__pb2
File ~\AppData\Roaming\Python\Python39\site-packages\tensorflow\core\framework\attr_value_pb2.py:16, in
11 # @@protoc_insertion_point(imports)
13 _sym_db = _symbol_database.Default()
---> 16 from tensorflow.core.framework import tensor_pb2 as tensorflow_dot_core_dot_framework_dot_tensor__pb2
17 from tensorflow.core.framework import tensor_shape_pb2 as tensorflow_dot_core_dot_framework_dot_tensor__shape__pb2
18 from tensorflow.core.framework import types_pb2 as tensorflow_dot_core_dot_framework_dot_types__pb2
File ~\AppData\Roaming\Python\Python39\site-packages\tensorflow\core\framework\tensor_pb2.py:16, in
11 # @@protoc_insertion_point(imports)
13 _sym_db = _symbol_database.Default()
---> 16 from tensorflow.core.framework import resource_handle_pb2 as tensorflow_dot_core_dot_framework_dot_resource__handle__pb2
17 from tensorflow.core.framework import tensor_shape_pb2 as tensorflow_dot_core_dot_framework_dot_tensor__shape__pb2
18 from tensorflow.core.framework import types_pb2 as tensorflow_dot_core_dot_framework_dot_types__pb2
File ~\AppData\Roaming\Python\Python39\site-packages\tensorflow\core\framework\resource_handle_pb2.py:16, in
11 # @@protoc_insertion_point(imports)
13 _sym_db = _symbol_database.Default()
---> 16 from tensorflow.core.framework import tensor_shape_pb2 as tensorflow_dot_core_dot_framework_dot_tensor__shape__pb2
17 from tensorflow.core.framework import types_pb2 as tensorflow_dot_core_dot_framework_dot_types__pb2
20 DESCRIPTOR = _descriptor.FileDescriptor(
21 name='tensorflow/core/framework/resource_handle.proto',
22 package='tensorflow',
(...)
26 ,
27 dependencies=[tensorflow_dot_core_dot_framework_dot_tensor__shape__pb2.DESCRIPTOR,tensorflow_dot_core_dot_framework_dot_types__pb2.DESCRIPTOR,])
File ~\AppData\Roaming\Python\Python39\site-packages\tensorflow\core\framework\tensor_shape_pb2.py:18, in
11 # @@protoc_insertion_point(imports)
13 _sym_db = _symbol_database.Default()
---> 18 DESCRIPTOR = _descriptor.FileDescriptor(
19 name='tensorflow/core/framework/tensor_shape.proto',
20 package='tensorflow',
21 syntax='proto3',
22 serialized_options=_b('\n\030org.tensorflow.frameworkB\021TensorShapeProtosP\001ZSgithub.com/tensorflow/tensorflow/tensorflow/go/core/framework/tensor_shape_go_proto\370\001\001'),
23 serialized_pb=_b('\n,tensorflow/core/framework/tensor_shape.proto\x12\ntensorflow"z\n\x10TensorShapeProto\x12-\n\x03\x64im\x18\x02 \x03(\x0b\x32 .tensorflow.TensorShapeProto.Dim\x12\x14\n\x0cunknown_rank\x18\x03 \x01(\x08\x1a!\n\x03\x44im\x12\x0c\n\x04size\x18\x01 \x01(\x03\x12\x0c\n\x04name\x18\x02 \x01(\tB\x87\x01\n\x18org.tensorflow.frameworkB\x11TensorShapeProtosP\x01ZSgithub.com/tensorflow/tensorflow/tensorflow/go/core/framework/tensor_shape_go_proto\xf8\x01\x01\x62\x06proto3')
24 )
29 _TENSORSHAPEPROTO_DIM = _descriptor.Descriptor(
30 name='Dim',
31 full_name='tensorflow.TensorShapeProto.Dim',
(...)
63 serialized_end=182,
64 )
66 _TENSORSHAPEPROTO = _descriptor.Descriptor(
67 name='TensorShapeProto',
68 full_name='tensorflow.TensorShapeProto',
(...)
100 serialized_end=182,
101 )
TypeError: init() got an unexpected keyword argument 'serialized_options