TypeError: __new__() got an unexpected keyword argument 'serialized_options'

from tensorboardX import SummaryWriter

 

出错

Traceback (most recent call last):
  File "D:/pytorch/SRDenseNet-pytorch-master/train.py", line 20, in
    from tensorboardX import SummaryWriter
  File "C:\ProgramData\Anaconda3\lib\site-packages\tensorboardX\__init__.py", line 5, in
    from .torchvis import TorchVis
  File "C:\ProgramData\Anaconda3\lib\site-packages\tensorboardX\torchvis.py", line 11, in
    from .writer import SummaryWriter
  File "C:\ProgramData\Anaconda3\lib\site-packages\tensorboardX\writer.py", line 27, in
    from .event_file_writer import EventFileWriter
  File "C:\ProgramData\Anaconda3\lib\site-packages\tensorboardX\event_file_writer.py", line 28, in
    from .proto import event_pb2
  File "C:\ProgramData\Anaconda3\lib\site-packages\tensorboardX\proto\event_pb2.py", line 15, in
    from tensorboardX.proto import summary_pb2 as tensorboardX_dot_proto_dot_summary__pb2
  File "C:\ProgramData\Anaconda3\lib\site-packages\tensorboardX\proto\summary_pb2.py", line 15, in
    from tensorboardX.proto import tensor_pb2 as tensorboardX_dot_proto_dot_tensor__pb2
  File "C:\ProgramData\Anaconda3\lib\site-packages\tensorboardX\proto\tensor_pb2.py", line 15, in
    from tensorboardX.proto import resource_handle_pb2 as tensorboardX_dot_proto_dot_resource__handle__pb2
  File "C:\ProgramData\Anaconda3\lib\site-packages\tensorboardX\proto\resource_handle_pb2.py", line 22, in
    serialized_pb=_b('\n(tensorboardX/proto/resource_handle.proto\x12\x0ctensorboardX\"r\n\x13ResourceHandleProto\x12\x0e\n\x06\x64\x65vice\x18\x01 \x01(\t\x12\x11\n\tcontainer\x18\x02 \x01(\t\x12\x0c\n\x04name\x18\x03 \x01(\t\x12\x11\n\thash_code\x18\x04 \x01(\x04\x12\x17\n\x0fmaybe_type_name\x18\x05 \x01(\tB/\n\x18org.tensorflow.frameworkB\x0eResourceHandleP\x01\xf8\x01\x01\x62\x06proto3')
TypeError: __new__() got an unexpected keyword argument 'serialized_options'
 

 

 

解决办法:

 

pip uninstall protobuf
pip install -U protobuf

你可能感兴趣的:(pytorch)