build成功后,代码部分的报错
Building recorder
Step 1/9 : FROM python:3.11
---> ee4e7a0f1c35
Step 2/9 : ADD apt/sources.list /etc/apt/sources.list
---> Using cache
---> 7899a0349dc1
Step 3/9 : RUN apt-get update && apt-get install -y ffmpeg
---> Using cache
---> a24430cf1f78
Step 4/9 : WORKDIR /usr/src/app
---> Using cache
---> 30316c42eaf0
Step 5/9 : COPY requirements.txt ./
---> Using cache
---> 597271336cc9
Step 6/9 : RUN python3 -m pip install --upgrade pip && pip config set global.index-url https://pypi.tuna.tsinghua.edu.cn/simple
---> Using cache
---> e83fc5c926c3
Step 7/9 : RUN pip install --no-cache-dir -r requirements.txt
---> Using cache
---> 20b2f3513345
Step 8/9 : COPY . .
---> c34a39f5a5bc
Step 9/9 : CMD ["python3", "-u", "main.py", "config/config.json"]
---> Running in eb9fd173b66f
Removing intermediate container eb9fd173b66f
---> 5c1e991f0e0d
Successfully built 5c1e991f0e0d
Successfully tagged ddrecorder-130_recorder:latest
Recreating ddrecorder-130_recorder_1 ... done
Attaching to ddrecorder-130_recorder_1
recorder_1 | Traceback (most recent call last):
recorder_1 | File "/usr/src/app/main.py", line 11, in <module>
recorder_1 | import utils
recorder_1 | File "/usr/src/app/utils.py", line 12, in <module>
recorder_1 | from fastHan import FastHan
recorder_1 | File "/usr/local/lib/python3.11/site-packages/fastHan/__init__.py", line 7, in <module>
recorder_1 | from .FastModel import FastHan,Sentence,Token
recorder_1 | File "/usr/local/lib/python3.11/site-packages/fastHan/FastModel.py", line 6, in <module>
recorder_1 | from fastNLP import Trainer, Vocabulary
recorder_1 | File "/usr/local/lib/python3.11/site-packages/fastNLP/__init__.py", line 3, in <module>
recorder_1 | from fastNLP.core import *
recorder_1 | File "/usr/local/lib/python3.11/site-packages/fastNLP/core/__init__.py", line 114, in <module>
recorder_1 | from .callbacks import *
recorder_1 | File "/usr/local/lib/python3.11/site-packages/fastNLP/core/callbacks/__init__.py", line 41, in <module>
recorder_1 | from .torch_callbacks import *
recorder_1 | File "/usr/local/lib/python3.11/site-packages/fastNLP/core/callbacks/torch_callbacks/__init__.py", line 8, in <module>
recorder_1 | from .torch_grad_clip_callback import TorchGradClipCallback
recorder_1 | File "/usr/local/lib/python3.11/site-packages/fastNLP/core/callbacks/torch_callbacks/torch_grad_clip_callback.py", line 6, in <module>
recorder_1 | from ...drivers.torch_driver.fairscale import FairScaleDriver
recorder_1 | File "/usr/local/lib/python3.11/site-packages/fastNLP/core/drivers/__init__.py", line 30, in <module>
recorder_1 | from .torch_driver import TorchDriver, TorchSingleDriver, TorchDDPDriver, DeepSpeedDriver, FairScaleDriver, \
recorder_1 | File "/usr/local/lib/python3.11/site-packages/fastNLP/core/drivers/torch_driver/__init__.py", line 18, in <module>
recorder_1 | from .torch_fsdp import TorchFSDPDriver
recorder_1 | File "/usr/local/lib/python3.11/site-packages/fastNLP/core/drivers/torch_driver/torch_fsdp.py", line 7, in <module>
recorder_1 | from torch.distributed.fsdp import FullyShardedDataParallel, StateDictType, FullStateDictConfig, OptimStateKeyType
recorder_1 | File "/usr/local/lib/python3.11/site-packages/torch/distributed/fsdp/__init__.py", line 1, in <module>
recorder_1 | from .flat_param import FlatParameter
recorder_1 | File "/usr/local/lib/python3.11/site-packages/torch/distributed/fsdp/flat_param.py", line 26, in <module>
recorder_1 | from ._fsdp_extensions import _ext_post_unflatten_transform, _ext_pre_flatten_transform
recorder_1 | File "/usr/local/lib/python3.11/site-packages/torch/distributed/fsdp/_fsdp_extensions.py", line 7, in <module>
recorder_1 | from torch.distributed.fsdp._shard_utils import _create_chunk_sharded_tensor
recorder_1 | File "/usr/local/lib/python3.11/site-packages/torch/distributed/fsdp/_shard_utils.py", line 10, in <module>
recorder_1 | from torch.distributed._shard.sharded_tensor import (
recorder_1 | File "/usr/local/lib/python3.11/site-packages/torch/distributed/_shard/__init__.py", line 1, in <module>
recorder_1 | from .api import (
recorder_1 | File "/usr/local/lib/python3.11/site-packages/torch/distributed/_shard/api.py", line 6, in <module>
recorder_1 | from torch.distributed._shard.sharded_tensor import (
recorder_1 | File "/usr/local/lib/python3.11/site-packages/torch/distributed/_shard/sharded_tensor/__init__.py", line 8, in <module>
recorder_1 | import torch.distributed._shard.sharding_spec as shard_spec
recorder_1 | File "/usr/local/lib/python3.11/site-packages/torch/distributed/_shard/sharding_spec/__init__.py", line 1, in <module>
recorder_1 | from .api import (
recorder_1 | File "/usr/local/lib/python3.11/site-packages/torch/distributed/_shard/sharding_spec/api.py", line 16, in <module>
recorder_1 | import torch.distributed._shard.sharded_tensor.metadata as sharded_tensor_meta
recorder_1 | File "/usr/local/lib/python3.11/site-packages/torch/distributed/_shard/sharded_tensor/metadata.py", line 70, in <module>
recorder_1 | @dataclass
recorder_1 | ^^^^^^^^^
recorder_1 | File "/usr/local/lib/python3.11/dataclasses.py", line 1221, in dataclass
recorder_1 | return wrap(cls)
recorder_1 | ^^^^^^^^^
recorder_1 | File "/usr/local/lib/python3.11/dataclasses.py", line 1211, in wrap
recorder_1 | return _process_class(cls, init, repr, eq, order, unsafe_hash,
recorder_1 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
recorder_1 | File "/usr/local/lib/python3.11/dataclasses.py", line 959, in _process_class
recorder_1 | cls_fields.append(_get_field(cls, name, type, kw_only))
recorder_1 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
recorder_1 | File "/usr/local/lib/python3.11/dataclasses.py", line 816, in _get_field
recorder_1 | raise ValueError(f'mutable default {type(f.default)} for field '
recorder_1 | ValueError: mutable default <class 'torch.distributed._shard.sharded_tensor.metadata.TensorProperties'> for field tensor_properties is not allowed: use default_factory
以下是 config 配置,按照文档填写(隐去账户信息),是否和配置有关?
{
"root": {
"check_interval": 60,
"print_interval": 10,
"data_path": "./",
"logger": { "log_path": "./log", "log_level": "DEBUG" },
"request_header": {},
"uploader": {
"upload_by_edit": true,
"thread_pool_workers": 1,
"max_retry": 30,
"lines":"AUTO"
},
"enable_baiduyun": false
},
"spec": [
{
"room_id": "000",
"recorder": { "keep_raw_record": false },
"parser": {
"interval": 30,
"up_ratio": 2.5,
"down_ratio": 0.75,
"topK": 5
},
"clipper": {
"enable_clipper": true,
"min_length": 30,
"start_offset": -20,
"end_offset": 10
},
"manual_clipper": {
"enabled": true,
"uid": "000"
},
"uploader": {
"account": {
"username": "1",
"password": "2",
"access_token": "3",
"refresh_token": "4",
"cookies": {
"SESSDATA": "5",
"bili_jct": "6",
"DedeUserID": "7",
"DedeUserID__ckMd5": "8",
"sid": "9"
}
},
"copyright": 2,
"record": {
"upload_record": true,
"keep_record_after_upload": true,
"split_interval": 3600,
"title": "【TEST】{date}直播录播",
"tid": 27,
"tags": ["直播录播", "虚拟主播", "VTuber", "虚拟UP主"],
"desc": "切片自{date} 直播\n---------------------------------------\n自用",
"cover": ""
},
"clips": {
"upload_clips": true,
"keep_clips_after_upload": false,
"title": "{date}直播精彩剪辑【自动切片】",
"tid": 27,
"tags": ["直播录播", "虚拟主播", "VTuber", "虚拟UP主"],
"desc": "切片自 {date} 自用",
"cover": ""
}
},
"backup": false
}
]
}