Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

安装依赖库之后运行llamafactory-cli相关指令报错提示No Module named 'flatbuffers' 但是我的site-packages和conda list都显示有 #5048

Closed
1 task done
Zeppelinpp opened this issue Aug 2, 2024 · 4 comments
Labels
solved This problem has been already solved

Comments

@Zeppelinpp
Copy link

Reminder

  • I have read the README and searched the existing issues.

System Info

python==3.11.9

Reproduction

2024-08-02 10:01:40.594531: I tensorflow/core/util/port.cc:113] oneDNN custom operations are on. You may see slightly different numerical results due to floating-point round-off errors from different computation orders. To turn them off, set the environment variable TF_ENABLE_ONEDNN_OPTS=0.
2024-08-02 10:01:41.957354: E external/local_xla/xla/stream_executor/cuda/cuda_dnn.cc:9261] Unable to register cuDNN factory: Attempting to register factory for plugin cuDNN when one has already been registered
2024-08-02 10:01:41.957496: E external/local_xla/xla/stream_executor/cuda/cuda_fft.cc:607] Unable to register cuFFT factory: Attempting to register factory for plugin cuFFT when one has already been registered
2024-08-02 10:01:42.143347: E external/local_xla/xla/stream_executor/cuda/cuda_blas.cc:1515] Unable to register cuBLAS factory: Attempting to register factory for plugin cuBLAS when one has already been registered
2024-08-02 10:01:42.542183: I tensorflow/core/platform/cpu_feature_guard.cc:182] This TensorFlow binary is optimized to use available CPU instructions in performance-critical operations.
To enable the following instructions: AVX2 AVX512F AVX512_VNNI FMA, in other operations, rebuild TensorFlow with the appropriate compiler flags.
Traceback (most recent call last):
File "/data1/home/purui/.local/lib/python3.10/site-packages/transformers/utils/import_utils.py", line 1586, in _get_module
return importlib.import_module("." + module_name, self.name)
File "/data1/home/wenxibing/anaconda3/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 992, in _find_and_load_unlocked
File "", line 241, in _call_with_frames_removed
File "", line 1050, in _gcd_import
File "", line 1027, in _find_and_load
File "", line 1006, in _find_and_load_unlocked
File "", line 688, in _load_unlocked
File "", line 883, in exec_module
File "", line 241, in _call_with_frames_removed
File "/data1/home/purui/.local/lib/python3.10/site-packages/transformers/data/init.py", line 27, in
from .processors import (
File "/data1/home/purui/.local/lib/python3.10/site-packages/transformers/data/processors/init.py", line 15, in
from .glue import glue_convert_examples_to_features, glue_output_modes, glue_processors, glue_tasks_num_labels
File "/data1/home/purui/.local/lib/python3.10/site-packages/transformers/data/processors/glue.py", line 30, in
import tensorflow as tf
File "/data1/home/wenxibing/anaconda3/lib/python3.10/site-packages/tensorflow/init.py", line 54, in
from tensorflow._api.v2 import compat
File "/data1/home/wenxibing/anaconda3/lib/python3.10/site-packages/tensorflow/_api/v2/compat/init.py", line 8, in
from tensorflow._api.v2.compat import v1
File "/data1/home/wenxibing/anaconda3/lib/python3.10/site-packages/tensorflow/_api/v2/compat/v1/init.py", line 32, in
from tensorflow._api.v2.compat.v1 import compat
File "/data1/home/wenxibing/anaconda3/lib/python3.10/site-packages/tensorflow/_api/v2/compat/v1/compat/init.py", line 8, in
from tensorflow._api.v2.compat.v1.compat import v1
File "/data1/home/wenxibing/anaconda3/lib/python3.10/site-packages/tensorflow/_api/v2/compat/v1/compat/v1/init.py", line 49, in
from tensorflow._api.v2.compat.v1 import lite
File "/data1/home/wenxibing/anaconda3/lib/python3.10/site-packages/tensorflow/_api/v2/compat/v1/lite/init.py", line 9, in
from tensorflow._api.v2.compat.v1.lite import experimental
File "/data1/home/wenxibing/anaconda3/lib/python3.10/site-packages/tensorflow/_api/v2/compat/v1/lite/experimental/init.py", line 8, in
from tensorflow._api.v2.compat.v1.lite.experimental import authoring
File "/data1/home/wenxibing/anaconda3/lib/python3.10/site-packages/tensorflow/_api/v2/compat/v1/lite/experimental/authoring/init.py", line 8, in
from tensorflow.lite.python.authoring.authoring import compatible # line: 265
File "/data1/home/wenxibing/anaconda3/lib/python3.10/site-packages/tensorflow/lite/python/authoring/authoring.py", line 43, in
from tensorflow.lite.python import convert
File "/data1/home/wenxibing/anaconda3/lib/python3.10/site-packages/tensorflow/lite/python/convert.py", line 29, in
from tensorflow.lite.python import util
File "/data1/home/wenxibing/anaconda3/lib/python3.10/site-packages/tensorflow/lite/python/util.py", line 22, in
import flatbuffers
ModuleNotFoundError: No module named 'flatbuffers'

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
File "/data1/home/purui/.local/bin/llamafactory-cli", line 5, in
from llamafactory.cli import main
File "/data1/home/purui/projects/LLaMA-Factory/src/llamafactory/init.py", line 38, in
from .cli import VERSION
File "/data1/home/purui/projects/LLaMA-Factory/src/llamafactory/cli.py", line 21, in
from . import launcher
File "/data1/home/purui/projects/LLaMA-Factory/src/llamafactory/launcher.py", line 15, in
from llamafactory.train.tuner import run_exp
File "/data1/home/purui/projects/LLaMA-Factory/src/llamafactory/train/tuner.py", line 22, in
from ..data import get_template_and_fix_tokenizer
File "/data1/home/purui/projects/LLaMA-Factory/src/llamafactory/data/init.py", line 15, in
from .collator import KTODataCollatorWithPadding, PairwiseDataCollatorWithPadding, SFTDataCollatorWith4DAttentionMask
File "/data1/home/purui/projects/LLaMA-Factory/src/llamafactory/data/collator.py", line 22, in
from transformers import DataCollatorForSeq2Seq
File "", line 1075, in _handle_fromlist
File "/data1/home/purui/.local/lib/python3.10/site-packages/transformers/utils/import_utils.py", line 1576, in getattr
module = self._get_module(self._class_to_module[name])
File "/data1/home/purui/.local/lib/python3.10/site-packages/transformers/utils/import_utils.py", line 1588, in _get_module
raise RuntimeError(
RuntimeError: Failed to import transformers.data.data_collator because of the following error (look up to see its traceback):
No module named 'flatbuffers'

Expected behavior

运行llamafactory-cli webui出现报错,运行其他llamafactory-cli指令都会报相同错误

Others

No response

@github-actions github-actions bot added the pending This problem is yet to be addressed label Aug 2, 2024
@codemayq
Copy link
Collaborator

codemayq commented Aug 2, 2024

你重新升级一下 transformers 到4.43.1 以上版本看看

@Katehuuh
Copy link
Contributor

Katehuuh commented Aug 4, 2024

你重新升级一下 transformers 到4.43.1 以上版本看看

Does that mean Llama-3.1 will not benefit from --neat_packing True due to the required module transformers<=4.42.4?

require_version("transformers>=4.41.2,<=4.42.4", "To fix: pip install transformers>=4.41.2,<=4.42.4")

longlora:
transformers>=4.41.2,<=4.42.4
packing:
transformers>=4.41.2,<=4.42.4
patcher:
transformers==4.41.2 (chatglm)

@hiyouga
Copy link
Owner

hiyouga commented Aug 5, 2024

@Katehuuh fixed

@hiyouga hiyouga closed this as completed in b7ca6c8 Aug 5, 2024
@hiyouga hiyouga added solved This problem has been already solved and removed pending This problem is yet to be addressed labels Aug 5, 2024
@Zeppelinpp
Copy link
Author

新建一个python 3.10的环境之后不加载cache重新安装相关依赖之后就OK了,之前用的是python 3.11.9 。具体为什么还不太清楚

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
solved This problem has been already solved
Projects
None yet
Development

No branches or pull requests

4 participants