LMFlow icon indicating copy to clipboard operation
LMFlow copied to clipboard

[BUG] ImportError: cannot import name 'UnencryptedCookieSessionFactoryConfig' from 'pyramid.session'

Open kulame opened this issue 2 years ago • 1 comments

Describe the bug

python service/app.py

CUDA_SETUP: WARNING! libcudart.so not found in any environmental path. Searching in backup paths...
CUDA SETUP: CUDA runtime path found: /usr/local/cuda/lib64/libcudart.so
CUDA SETUP: Highest compute capability among GPUs detected: 8.9
CUDA SETUP: Detected CUDA version 121
CUDA SETUP: Loading binary /usr/local/lib/python3.10/dist-packages/bitsandbytes/libbitsandbytes_cuda121.so...
╭─────────────────── Traceback (most recent call last) ────────────────────╮
│ /usr/local/lib/python3.10/dist-packages/transformers/utils/import_utils. │
│ py:1125 in _get_module                                                   │
│                                                                          │
│   1122 │                                                                 │
│   1123 │   def _get_module(self, module_name: str):                      │
│   1124 │   │   try:                                                      │
│ ❱ 1125 │   │   │   return importlib.import_module("." + module_name, sel │
│   1126 │   │   except Exception as e:                                    │
│   1127 │   │   │   raise RuntimeError(                                   │
│   1128 │   │   │   │   f"Failed to import {self.__name__}.{module_name}  │
│                                                                          │
│ /usr/lib/python3.10/importlib/__init__.py:126 in import_module           │
│                                                                          │
│   123 │   │   │   if character != '.':                                   │
│   124 │   │   │   │   break                                              │
│   125 │   │   │   level += 1                                             │
│ ❱ 126 │   return _bootstrap._gcd_import(name[level:], package, level)    │
│   127                                                                    │
│   128                                                                    │
│   129 _RELOADING = {}                                                    │
│ in _gcd_import:1050                                                      │
│ in _find_and_load:1027                                                   │
│ in _find_and_load_unlocked:1006                                          │
│ in _load_unlocked:688                                                    │
│ in exec_module:883                                                       │
│ in _call_with_frames_removed:241                                         │
│                                                                          │
│ /usr/local/lib/python3.10/dist-packages/transformers/trainer.py:170 in   │
│ <module>                                                                 │
│                                                                          │
│    167 │   DEFAULT_PROGRESS_CALLBACK = NotebookProgressCallback          │
│    168                                                                   │
│    169 if is_apex_available():                                           │
│ ❱  170 │   from apex import amp                                          │
│    171                                                                   │
│    172 if is_datasets_available():                                       │
│    173 │   import datasets                                               │
│                                                                          │
│ /home/kula/.local/lib/python3.10/site-packages/apex/__init__.py:13 in    │
│ <module>                                                                 │
│                                                                          │
│    10 │   │   │   │   │   │   │   │   IAuthorizationPolicy,              │
│    11 │   │   │   │   │   │   │   │   ISessionFactory)                   │
│    12 from pyramid.security import NO_PERMISSION_REQUIRED                │
│ ❱  13 from pyramid.session import UnencryptedCookieSessionFactoryConfig  │
│    14 from pyramid.settings import asbool                                │
│    15                                                                    │
│    16 from apex.exceptions import (ApexAuthSecret,                       │
╰──────────────────────────────────────────────────────────────────────────╯
ImportError: cannot import name 'UnencryptedCookieSessionFactoryConfig' from
'pyramid.session' (unknown location)

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

╭─────────────────── Traceback (most recent call last) ────────────────────╮
│ /srv/chat/LMFlow/service/app.py:14 in <module>                           │
│                                                                          │
│    11 from typing import Optional                                        │
│    12                                                                    │
│    13 from lmflow.datasets.dataset import Dataset                        │
│ ❱  14 from lmflow.pipeline.auto_pipeline import AutoPipeline             │
│    15 from lmflow.models.auto_model import AutoModel                     │
│    16 from lmflow.args import ModelArguments, DatasetArguments, AutoArgu │
│    17                                                                    │
│                                                                          │
│ /srv/chat/LMFlow/src/lmflow/pipeline/auto_pipeline.py:7 in <module>      │
│                                                                          │
│    4 """                                                                 │
│    5                                                                     │
│    6 from lmflow.pipeline.evaluator import Evaluator                     │
│ ❱  7 from lmflow.pipeline.finetuner import Finetuner                     │
│    8 from lmflow.pipeline.inferencer import Inferencer                   │
│    9 from lmflow.pipeline.raft_aligner import RaftAligner                │
│   10                                                                     │
│                                                                          │
│ /srv/chat/LMFlow/src/lmflow/pipeline/finetuner.py:15 in <module>         │
│                                                                          │
│    12 import transformers                                                │
│    13 import evaluate                                                    │
│    14 from itertools import chain                                        │
│ ❱  15 from transformers import (                                         │
│    16 │   Trainer,                                                       │
│    17 │   default_data_collator,                                         │
│    18 │   set_seed,                                                      │
│ in _handle_fromlist:1075                                                 │
│                                                                          │
│ /usr/local/lib/python3.10/dist-packages/transformers/utils/import_utils. │
│ py:1115 in __getattr__                                                   │
│                                                                          │
│   1112 │   │   if name in self._modules:                                 │
│   1113 │   │   │   value = self._get_module(name)                        │
│   1114 │   │   elif name in self._class_to_module.keys():                │
│ ❱ 1115 │   │   │   module = self._get_module(self._class_to_module[name] │
│   1116 │   │   │   value = getattr(module, name)                         │
│   1117 │   │   else:                                                     │
│   1118 │   │   │   raise AttributeError(f"module {self.__name__} has no  │
│                                                                          │
│ /usr/local/lib/python3.10/dist-packages/transformers/utils/import_utils. │
│ py:1127 in _get_module                                                   │
│                                                                          │
│   1124 │   │   try:                                                      │
│   1125 │   │   │   return importlib.import_module("." + module_name, sel │
│   1126 │   │   except Exception as e:                                    │
│ ❱ 1127 │   │   │   raise RuntimeError(                                   │
│   1128 │   │   │   │   f"Failed to import {self.__name__}.{module_name}  │
│   1129 │   │   │   │   f" traceback):\n{e}"                              │
│   1130 │   │   │   ) from e                                              │
╰──────────────────────────────────────────────────────────────────────────╯
RuntimeError: Failed to import transformers.trainer because of the following
error (look up to see its traceback):
cannot import name 'UnencryptedCookieSessionFac

kulame avatar Jun 18 '23 14:06 kulame

I noticed that you are using CUDA==12.1. Both Pytorch and LMFlow does not support cuda121. Could you try to use 11.3=<CUDA<=11.7? Thanks!

shizhediao avatar Jun 22 '23 15:06 shizhediao