DialoGPT icon indicating copy to clipboard operation
DialoGPT copied to clipboard

dbm.error: need 'c' or 'n' flag to open new db

Open Xiaomi2008 opened this issue 6 years ago • 7 comments

Got an error below when trying to run demo.py: Traceback (most recent call last): File "LSP_train.py", line 176, in args.max_seq_length) File "/source/project/DialoGPT/data_loader.py", line 114, in init self.db = shelve.open(f'{db_name}/db', 'r') File "/anaconda3/envs/LSP/lib/python3.6/shelve.py", line 243, in open return DbfilenameShelf(filename, flag, protocol, writeback) File "/anaconda3/envs/LSP/lib/python3.6/shelve.py", line 227, in init Shelf.init(self, dbm.open(filename, flag), protocol, writeback) File "/anaconda3/envs/LSP/lib/python3.6/dbm/init.py", line 85, in open raise error[0]("need 'c' or 'n' flag to open new db") dbm.error: need 'c' or 'n' flag to open new db Exception ignored in: <bound method BucketingDataLoader.del of <data_loader.BucketingDataLoader object at 0x7f49527775f8>> Traceback (most recent call last): File "/DialoGPT/data_loader.py", line 151, in del self.db.close() AttributeError: 'BucketingDataLoader' object has no attribute 'db'

Xiaomi2008 avatar Oct 16 '19 02:10 Xiaomi2008

The error message indicate that the db file you make can not be loaded. Can you send us more information? Are you running the demo.py via anaconda environment or docker?

dreasysnail avatar Oct 16 '19 20:10 dreasysnail

Got the same problem.

dimeldo avatar Oct 18 '19 18:10 dimeldo

We have fixed the issue. Thanks for the feedback!

dreasysnail avatar Oct 19 '19 02:10 dreasysnail

Hi,

Thanks for your repo.

I have got the same problem here.

Andrea

andreamad8 avatar Oct 31 '19 09:10 andreamad8

Hi,

Thanks for your repo.

I have got the same problem here.

Andrea

Hi Andrea,

Thanks for your interests. Can you help us double check if you are using our latest commit? If yes could you provide more information, like

  1. Your OS
  2. which environment are you using
  3. The file names and their size under data folder (by using ls -lh under linux)?

Thanks again for your interests.

Best,

Siqi

intersun avatar Nov 02 '19 07:11 intersun

I'm having this issue running dialoGPT "demo.py" script in docker environment on UBUNTU 16.04. I created a tsv file, then replaced the "train.tsv" reference in demo.py with my new tsv file name. I'm using demo.py because it seemed simpler than digging through LSP_train.py trying to work out all the arguments myself. I don't really know what im doing..

full error:

Traceback (most recent call last):
  File "LSP_train.py", line 177, in <module>
    args.max_seq_length)
  File "/workspace/data_loader.py", line 114, in __init__
    self.db = shelve.open(f'{db_name}/db', 'r')
  File "/opt/conda/envs/pytorch-py3.6/lib/python3.6/shelve.py", line 243, in open
    return DbfilenameShelf(filename, flag, protocol, writeback)
  File "/opt/conda/envs/pytorch-py3.6/lib/python3.6/shelve.py", line 227, in __init__
    Shelf.__init__(self, dbm.open(filename, flag), protocol, writeback)
  File "/opt/conda/envs/pytorch-py3.6/lib/python3.6/dbm/__init__.py", line 85, in open
    raise error[0]("need 'c' or 'n' flag to open new db")
dbm.error: need 'c' or 'n' flag to open new db
Exception ignored in: <bound method BucketingDataLoader.__del__ of <data_loader.BucketingDataLoader object at 0x7fcf336421d0>>
Traceback (most recent call last):
  File "/workspace/data_loader.py", line 151, in __del__
    self.db.close()
AttributeError: 'BucketingDataLoader' object has no attribute 'db'
05/27/2020 08:34:29 - INFO - __main__ -   Done!

made-by-chris avatar May 27 '20 08:05 made-by-chris

I'm having this issue running dialoGPT "demo.py" script in docker environment on UBUNTU 16.04. I created a tsv file, then replaced the "train.tsv" reference in demo.py with my new tsv file name. I'm using demo.py because it seemed simpler than digging through LSP_train.py trying to work out all the arguments myself. I don't really know what im doing..

full error:

Traceback (most recent call last):
  File "LSP_train.py", line 177, in <module>
    args.max_seq_length)
  File "/workspace/data_loader.py", line 114, in __init__
    self.db = shelve.open(f'{db_name}/db', 'r')
  File "/opt/conda/envs/pytorch-py3.6/lib/python3.6/shelve.py", line 243, in open
    return DbfilenameShelf(filename, flag, protocol, writeback)
  File "/opt/conda/envs/pytorch-py3.6/lib/python3.6/shelve.py", line 227, in __init__
    Shelf.__init__(self, dbm.open(filename, flag), protocol, writeback)
  File "/opt/conda/envs/pytorch-py3.6/lib/python3.6/dbm/__init__.py", line 85, in open
    raise error[0]("need 'c' or 'n' flag to open new db")
dbm.error: need 'c' or 'n' flag to open new db
Exception ignored in: <bound method BucketingDataLoader.__del__ of <data_loader.BucketingDataLoader object at 0x7fcf336421d0>>
Traceback (most recent call last):
  File "/workspace/data_loader.py", line 151, in __del__
    self.db.close()
AttributeError: 'BucketingDataLoader' object has no attribute 'db'
05/27/2020 08:34:29 - INFO - __main__ -   Done!

I have same problem with DialoGPT. I tempted to run demo.py in docker environment on Ubuntu 20.04. The error is completely same with yours. If you solve the problem now, could you share your experiences? THKS!

AsteriaCao avatar Nov 13 '21 06:11 AsteriaCao