下载好了模型文件,根据readme加载模型:
from VisCPM import VisCPMChat
from PIL import Image
model_path = '/models/VisCPM-Paint'
viscpm_chat = VisCPMChat(model_path, image_safety_checker=True)
报错如下:
raceback (most recent call last):
File "/home/edcuser/models/VisCPM-main/predict.py", line 9, in
viscpm_chat = VisCPMChat(model_path, image_safety_checker=True)
File "/home/edcuser/models/VisCPM-main/VisCPM/viscpm_chat.py", line 36, in init
self.beit3_wrapper = create_model("beit3_large_patch16_224")
File "/home/edcuser/.conda/envs/cuda123_torch221/lib/python3.10/site-packages/timm/models/factory.py", line 71, in create_model
model = create_fn(pretrained=pretrained, pretrained_cfg=pretrained_cfg, kwargs)
File "/home/edcuser/models/VisCPM-main/VisCPM/models/beit3.py", line 110, in beit3_large_patch16_224
model = BEiT3Wrapper(args, kwargs)
File "/home/edcuser/models/VisCPM-main/VisCPM/models/beit3.py", line 52, in init
self.beit3 = BEiT3(args)
File "/home/edcuser/.conda/envs/cuda123_torch221/lib/python3.10/site-packages/torchscale/model/BEiT3.py", line 40, in init
self.encoder = Encoder(
File "/home/edcuser/.conda/envs/cuda123_torch221/lib/python3.10/site-packages/torchscale/architecture/encoder.py", line 209, in init
self.build_encoder_layer(
File "/home/edcuser/.conda/envs/cuda123_torch221/lib/python3.10/site-packages/torchscale/architecture/encoder.py", line 296, in build_encoder_layer
layer = EncoderLayer(
File "/home/edcuser/.conda/envs/cuda123_torch221/lib/python3.10/site-packages/torchscale/architecture/encoder.py", line 30, in init
self.self_attn = self.build_self_attention(self.embed_dim, args)
File "/home/edcuser/.conda/envs/cuda123_torch221/lib/python3.10/site-packages/torchscale/architecture/encoder.py", line 103, in build_self_attention
return MultiheadAttention(
File "/home/edcuser/.conda/envs/cuda123_torch221/lib/python3.10/site-packages/torchscale/component/multihead_attention.py", line 47, in init
MultiwayWrapper(args, LayerNorm(self.embed_dim, eps=args.layernorm_eps))
File "/home/edcuser/.conda/envs/cuda123_torch221/lib/python3.10/site-packages/apex/normalization/fused_layer_norm.py", line 268, in init
fused_layer_norm_cuda = importlib.import_module("fused_layer_norm_cuda")
File "/home/edcuser/.conda/envs/cuda123_torch221/lib/python3.10/importlib/init.py", line 126, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "", line 1050, in _gcd_import
File "", line 1027, in _find_and_load
File "", line 1006, in _find_and_load_unlocked
File "", line 674, in _load_unlocked
File "", line 571, in module_from_spec
File "", line 1176, in create_module
File "", line 241, in _call_with_frames_removed
ImportError: /home/edcuser/.conda/envs/cuda123_torch221/lib/python3.10/site-packages/fused_layer_norm_cuda.cpython-310-x86_64-linux-gnu.so: undefined symbol: _ZN2at4_ops19empty_memory_format4callEN3c108ArrayRefINS2_6SymIntEEENS2_8optionalINS2_10ScalarTypeEEENS6_INS2_6LayoutEEENS6_INS2_6DeviceEEENS6_IbEENS6_INS2_12MemoryFormatEEE
请问这个问题怎么解决?
下载好了模型文件,根据readme加载模型: from VisCPM import VisCPMChat from PIL import Image model_path = '/models/VisCPM-Paint' viscpm_chat = VisCPMChat(model_path, image_safety_checker=True)
报错如下: raceback (most recent call last): File "/home/edcuser/models/VisCPM-main/predict.py", line 9, in
viscpm_chat = VisCPMChat(model_path, image_safety_checker=True)
File "/home/edcuser/models/VisCPM-main/VisCPM/viscpm_chat.py", line 36, in init
self.beit3_wrapper = create_model("beit3_large_patch16_224")
File "/home/edcuser/.conda/envs/cuda123_torch221/lib/python3.10/site-packages/timm/models/factory.py", line 71, in create_model
model = create_fn(pretrained=pretrained, pretrained_cfg=pretrained_cfg, kwargs)
File "/home/edcuser/models/VisCPM-main/VisCPM/models/beit3.py", line 110, in beit3_large_patch16_224
model = BEiT3Wrapper(args, kwargs)
File "/home/edcuser/models/VisCPM-main/VisCPM/models/beit3.py", line 52, in init
self.beit3 = BEiT3(args)
File "/home/edcuser/.conda/envs/cuda123_torch221/lib/python3.10/site-packages/torchscale/model/BEiT3.py", line 40, in init
self.encoder = Encoder(
File "/home/edcuser/.conda/envs/cuda123_torch221/lib/python3.10/site-packages/torchscale/architecture/encoder.py", line 209, in init
self.build_encoder_layer(
File "/home/edcuser/.conda/envs/cuda123_torch221/lib/python3.10/site-packages/torchscale/architecture/encoder.py", line 296, in build_encoder_layer
layer = EncoderLayer(
File "/home/edcuser/.conda/envs/cuda123_torch221/lib/python3.10/site-packages/torchscale/architecture/encoder.py", line 30, in init
self.self_attn = self.build_self_attention(self.embed_dim, args)
File "/home/edcuser/.conda/envs/cuda123_torch221/lib/python3.10/site-packages/torchscale/architecture/encoder.py", line 103, in build_self_attention
return MultiheadAttention(
File "/home/edcuser/.conda/envs/cuda123_torch221/lib/python3.10/site-packages/torchscale/component/multihead_attention.py", line 47, in init
MultiwayWrapper(args, LayerNorm(self.embed_dim, eps=args.layernorm_eps))
File "/home/edcuser/.conda/envs/cuda123_torch221/lib/python3.10/site-packages/apex/normalization/fused_layer_norm.py", line 268, in init
fused_layer_norm_cuda = importlib.import_module("fused_layer_norm_cuda")
File "/home/edcuser/.conda/envs/cuda123_torch221/lib/python3.10/importlib/init.py", line 126, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "", line 1050, in _gcd_import
File "", line 1027, in _find_and_load
File "", line 1006, in _find_and_load_unlocked
File "", line 674, in _load_unlocked
File "", line 571, in module_from_spec
File "", line 1176, in create_module
File "", line 241, in _call_with_frames_removed
ImportError: /home/edcuser/.conda/envs/cuda123_torch221/lib/python3.10/site-packages/fused_layer_norm_cuda.cpython-310-x86_64-linux-gnu.so: undefined symbol: _ZN2at4_ops19empty_memory_format4callEN3c108ArrayRefINS2_6SymIntEEENS2_8optionalINS2_10ScalarTypeEEENS6_INS2_6LayoutEEENS6_INS2_6DeviceEEENS6_IbEENS6_INS2_12MemoryFormatEEE
请问这个问题怎么解决?