GithubHelp home page GithubHelp logo

Comments (4)

lihaoyang-ruc avatar lihaoyang-ruc commented on July 23, 2024

It seems you did not download the T5 checkpoints we provided.

image

from resdsql.

hmhm1190 avatar hmhm1190 commented on July 23, 2024

Ohh!! Thanks for pointing it out...

Actually is it possible to run inference script on cpu, I am having only 12 GB GPU and its showing Cuda out of memory error

(RESDSQL) [husainmalwat@localhost RESDSQL]$ sh scripts/inference/infer_text2sql.sh base spider
366it [00:22, 16.43it/s] 
100%|█████████████████████████████████████████████████████████████████████████████████████████████████████| 23/23 [00:20<00:00,  1.12it/s]
Namespace(batch_size=16, db_path='./database', dev_filepath='./data/preprocessed_data/resdsql_test.json', device='0,1', epochs=128, gradient_descent_step=4, learning_rate=3e-05, mode='eval', model_name_or_path='t5-3b', num_beams=8, num_return_sequences=8, original_dev_filepath='./data/spider/dev.json', output='./predictions/Spider-dev/resdsql_base/pred.sql', save_path='./models/text2sql-t5-base/checkpoint-39312', seed=42, tables_for_natsql='NatSQL/NatSQLv1_6/tables_for_natsql.json', target_type='sql', tensorboard_save_path='tensorboard_log/text2sql', train_filepath='data/preprocessed_data/resdsql_train_spider.json', use_adafactor=False)
  0%|                                                                                                              | 0/23 [00:00<?, ?it/s]
Traceback (most recent call last):
  File "text2sql.py", line 352, in <module>
    _test(opt)
  File "text2sql.py", line 293, in _test
    model_outputs = model.generate(
  File "/home/husainmalwat/anaconda3/envs/RESDSQL/lib/python3.8/site-packages/torch/autograd/grad_mode.py", line 27, in decorate_context
    return func(*args, **kwargs)
  File "/home/husainmalwat/anaconda3/envs/RESDSQL/lib/python3.8/site-packages/transformers/generation/utils.py", line 1524, in generate
    return self.beam_search(
  File "/home/husainmalwat/anaconda3/envs/RESDSQL/lib/python3.8/site-packages/transformers/generation/utils.py", line 2883, in beam_search
    model_kwargs["past_key_values"] = self._reorder_cache(model_kwargs["past_key_values"], beam_idx)
  File "/home/husainmalwat/anaconda3/envs/RESDSQL/lib/python3.8/site-packages/transformers/models/t5/modeling_t5.py", line 1815, in _reorder_cache
    layer_past_state.index_select(0, beam_idx.to(layer_past_state.device)),
RuntimeError: CUDA out of memory. Tried to allocate 192.00 MiB (GPU 0; 10.76 GiB total capacity; 9.69 GiB already allocated; 65.12 MiB free; 9.79 GiB reserved in total by PyTorch) If reserved memory is >> allocated memory try setting max_split_size_mb to avoid fragmentation.  See documentation for Memory Management and PYTORCH_CUDA_ALLOC_CONF

from resdsql.

lihaoyang-ruc avatar lihaoyang-ruc commented on July 23, 2024

Maybe you can reduce the text2natsql_model_bs in the inference script.

from resdsql.

hmhm1190 avatar hmhm1190 commented on July 23, 2024

thanks, working now

from resdsql.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.