google-research / google-research/t5x

Type error while running evaluation script

Open
#1,007 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Python
Stars
3k
Forks
338
PR merge metrics
No merged PRs in 30d

Description

I follow [this guide](https://github.com/google-research/t5x/blob/ee0832c3bb267e3a8555d3cb07547a927d6b2833/docs/usage/eval.md) to run evaluation.

I am using TPU. [This](https://github.com/google-research/t5x/blob/main/t5x/notebooks/README.md) is how I configure it.
```yaml
acceleratorType: v3-8
apiVersion: V2
os: Ubuntu 20.04.4 LTS (GNU/Linux 5.13.0-1027-gcp x86_64)
```

And I run the following command.

```bash
export CHECKPOINT_PATH='gs://t5-data/pretrained_models/cbqa/small_ssm_nq/model.ckpt-1110000'
export MIXTURE_OR_TASK_NAME='natural_questions_open'
export EVAL_OUTPUT_DIR="./model-eval"

python -m t5x.eval \
--gin_file=t5x/examples/t5/t5_1_1/examples/base_wmt_eval.gin \
--gin.CHECKPOINT_PATH=\"${EVAL_OUTPUT_DIR}\" \
--gin.EVAL_OUTPUT_DIR=\"${EVAL_OUTPUT_DIR}\" \
--gin.MIXTURE_OR_TASK_NAME=\"${MIXTURE_OR_TASK_NAME}\" \
--alsologtostderr
```

But I got this:
```
TypeError: evaluate() missing 1 required keyword-only argument: 'partitioner'
In call to configurable 'evaluate'
```
It seems like the partitioner is already configured [here](https://github.com/google-research/t5x/blob/ee0832c3bb267e3a8555d3cb07547a927d6b2833/t5x/examples/t5/t5_1_1/examples/base_wmt_eval.gin#L30), but I don't have an idea.

Also, there is some error about the `xla compiler` too. (See first line of full error)

Full error
2023-01-08 02:10:49.384988: W tensorflow/compiler/xla/stream_executor/platform/default/dso_loader.cc:64] Could not load dynamic library 'libcudart.so.11.0'; dlerror: libcudart.so.11.0: cannot open shared object file: No such file or directory; LD_LIBRARY_PATH: :/usr/local/lib
2023-01-08 02:10:49.984930: W tensorflow/compiler/xla/stream_executor/platform/default/dso_loader.cc:64] Could not load dynamic library 'libnvinfer.so.7'; dlerror: libnvinfer.so.7: cannot open shared object file: No such file or directory; LD_LIBRARY_PATH: :/usr/local/lib
2023-01-08 02:10:49.985040: W tensorflow/compiler/xla/stream_executor/platform/default/dso_loader.cc:64] Could not load dynamic library 'libnvinfer_plugin.so.7'; dlerror: libnvinfer_plugin.so.7: cannot open shared object file: No such file or directory; LD_LIBRARY_PATH: :/usr/local/lib
2023-01-08 02:10:49.985051: W tensorflow/compiler/tf2tensorrt/utils/py_utils.cc:38] TF-TRT Warning: Cannot dlopen some TensorRT libraries. If you would like to use Nvidia GPU with TensorRT, please make sure the missing libraries mentioned above are installed properly.
Rewritten gin arg: --gin_bindings=CHECKPOINT_PATH = "./model-eval"
Rewritten gin arg: --gin_bindings=EVAL_OUTPUT_DIR = "./model-eval"
Rewritten gin arg: --gin_bindings=MIXTURE_OR_TASK_NAME = "natural_questions_open"
2023-01-08 02:10:51.183270: W tensorflow/compiler/xla/stream_executor/platform/default/dso_loader.cc:64] Could not load dynamic library 'libcuda.so.1'; dlerror: libcuda.so.1: cannot open shared object file: No such file or directory; LD_LIBRARY_PATH: :/usr/local/lib
2023-01-08 02:10:51.183307: W tensorflow/compiler/xla/stream_executor/cuda/cuda_driver.cc:265] failed call to cuInit: UNKNOWN ERROR (303)
I0108 02:10:51.526863 140411627080768 resource_reader.py:50] system_path_file_exists:t5x/examples/t5/t5_1_1/examples/base_wmt_eval.gin
I0108 02:10:51.527714 140411627080768 resource_reader.py:37] gin-config opened resource file:/home/yujonglee/t5x/t5x/examples/t5/t5_1_1/examples/base_wmt_eval.gin
I0108 02:10:51.535648 140411627080768 resource_reader.py:50] system_path_file_exists:t5x/examples/t5/t5_1_1/base.gin
I0108 02:10:51.535801 140411627080768 resource_reader.py:37] gin-config opened resource file:/home/yujonglee/t5x/t5x/examples/t5/t5_1_1/base.gin
I0108 02:10:51.553523 140411627080768 gin_utils.py:86] Gin Configuration:
I0108 02:10:51.555749 140411627080768 gin_utils.py:88] from __gin__ import dynamic_registration
I0108 02:10:51.555834 140411627080768 gin_utils.py:88] import __main__ as eval_script
I0108 02:10:51.555875 140411627080768 gin_utils.py:88] import seqio
I0108 02:10:51.555909 140411627080768 gin_utils.py:88] from t5.data import mixtures
I0108 02:10:51.555946 140411627080768 gin_utils.py:88] from t5x import adafactor
I0108 02:10:51.555981 140411627080768 gin_utils.py:88] from t5x.examples.t5 import network
I0108 02:10:51.556013 140411627080768 gin_utils.py:88] from t5x import models
I0108 02:10:51.556046 140411627080768 gin_utils.py:88] from t5x import partitioning
I0108 02:10:51.556078 140411627080768 gin_utils.py:88] from t5x import utils
I0108 02:10:51.556109 140411627080768 gin_utils.py:88]
I0108 02:10:51.556141 140411627080768 gin_utils.py:88] # Macros:
I0108 02:10:51.556173 140411627080768 gin_utils.py:88] # ==============================================================================
I0108 02:10:51.556205 140411627080768 gin_utils.py:88] CHECKPOINT_PATH = './model-eval'
I0108 02:10:51.556236 140411627080768 gin_utils.py:88] DROPOUT_RATE = 0.0
I0108 02:10:51.556267 140411627080768 gin_utils.py:88] EVAL_OUTPUT_DIR = './model-eval'
I0108 02:10:51.556299 140411627080768 gin_utils.py:88] LABEL_SMOOTHING = 0.0
I0108 02:10:51.556330 140411627080768 gin_utils.py:88] LOSS_NORMALIZING_FACTOR = None
I0108 02:10:51.556361 140411627080768 gin_utils.py:88] MIXTURE_OR_TASK_NAME = 'natural_questions_open'
I0108 02:10:51.556393 140411627080768 gin_utils.py:88] MODEL = @models.EncoderDecoderModel()
I0108 02:10:51.556424 140411627080768 gin_utils.py:88] OPTIMIZER = @adafactor.Adafactor()
I0108 02:10:51.556455 140411627080768 gin_utils.py:88] VOCABULARY = @seqio.SentencePieceVocabulary()
I0108 02:10:51.556486 140411627080768 gin_utils.py:88] Z_LOSS = 0.0001
I0108 02:10:51.556517 140411627080768 gin_utils.py:88]
I0108 02:10:51.556548 140411627080768 gin_utils.py:88] # Parameters for adafactor.Adafactor:
I0108 02:10:51.556579 140411627080768 gin_utils.py:88] # ==============================================================================
I0108 02:10:51.556611 140411627080768 gin_utils.py:88] adafactor.Adafactor.decay_rate = 0.8
I0108 02:10:51.556642 140411627080768 gin_utils.py:88] adafactor.Adafactor.logical_factor_rules = \
I0108 02:10:51.556678 140411627080768 gin_utils.py:88] @adafactor.standard_logical_factor_rules()
I0108 02:10:51.556710 140411627080768 gin_utils.py:88] adafactor.Adafactor.step_offset = 0
I0108 02:10:51.556741 140411627080768 gin_utils.py:88]
I0108 02:10:51.556772 140411627080768 gin_utils.py:88] # Parameters for utils.DatasetConfig:
I0108 02:10:51.556803 140411627080768 gin_utils.py:88] # ==============================================================================
I0108 02:10:51.556834 140411627080768 gin_utils.py:88] utils.DatasetConfig.batch_size = 32
I0108 02:10:51.556865 140411627080768 gin_utils.py:88] utils.DatasetConfig.mixture_or_task_name = %MIXTURE_OR_TASK_NAME
I0108 02:10:51.556896 140411627080768 gin_utils.py:88] utils.DatasetConfig.seed = 42
I0108 02:10:51.556927 140411627080768 gin_utils.py:88] utils.DatasetConfig.shuffle = False
I0108 02:10:51.556959 140411627080768 gin_utils.py:88] utils.DatasetConfig.split = 'test'
I0108 02:10:51.556990 140411627080768 gin_utils.py:88] utils.DatasetConfig.task_feature_lengths = None
I0108 02:10:51.557021 140411627080768 gin_utils.py:88]
I0108 02:10:51.557052 140411627080768 gin_utils.py:88] # Parameters for models.EncoderDecoderModel:
I0108 02:10:51.557083 140411627080768 gin_utils.py:88] # ==============================================================================
I0108 02:10:51.557115 140411627080768 gin_utils.py:88] models.EncoderDecoderModel.input_vocabulary = %VOCABULARY
I0108 02:10:51.557146 140411627080768 gin_utils.py:88] models.EncoderDecoderModel.label_smoothing = %LABEL_SMOOTHING
I0108 02:10:51.557178 140411627080768 gin_utils.py:88] models.EncoderDecoderModel.loss_normalizing_factor = %LOSS_NORMALIZING_FACTOR
I0108 02:10:51.557209 140411627080768 gin_utils.py:88] models.EncoderDecoderModel.module = @network.Transformer()
I0108 02:10:51.557240 140411627080768 gin_utils.py:88] models.EncoderDecoderModel.optimizer_def = %OPTIMIZER
I0108 02:10:51.557271 140411627080768 gin_utils.py:88] models.EncoderDecoderModel.output_vocabulary = %VOCABULARY
I0108 02:10:51.557302 140411627080768 gin_utils.py:88] models.EncoderDecoderModel.z_loss = %Z_LOSS
I0108 02:10:51.557333 140411627080768 gin_utils.py:88]
I0108 02:10:51.557364 140411627080768 gin_utils.py:88] # Parameters for eval_script.evaluate:
I0108 02:10:51.557395 140411627080768 gin_utils.py:88] # ==============================================================================
I0108 02:10:51.557438 140411627080768 gin_utils.py:88] eval_script.evaluate.dataset_cfg = @utils.DatasetConfig()
I0108 02:10:51.557500 140411627080768 gin_utils.py:88] eval_script.evaluate.model = %MODEL
I0108 02:10:51.557533 140411627080768 gin_utils.py:88] eval_script.evaluate.output_dir = %EVAL_OUTPUT_DIR
I0108 02:10:51.557565 140411627080768 gin_utils.py:88] eval_script.evaluate.restore_checkpoint_cfg = @utils.RestoreCheckpointConfig()
I0108 02:10:51.557599 140411627080768 gin_utils.py:88]
I0108 02:10:51.557631 140411627080768 gin_utils.py:88] # Parameters for partitioning.PjitPartitioner:
I0108 02:10:51.557664 140411627080768 gin_utils.py:88] # ==============================================================================
I0108 02:10:51.557702 140411627080768 gin_utils.py:88] partitioning.PjitPartitioner.num_partitions = 2
I0108 02:10:51.557735 140411627080768 gin_utils.py:88]
I0108 02:10:51.557780 140411627080768 gin_utils.py:88] # Parameters for utils.RestoreCheckpointConfig:
I0108 02:10:51.557814 140411627080768 gin_utils.py:88] # ==============================================================================
I0108 02:10:51.557847 140411627080768 gin_utils.py:88] utils.RestoreCheckpointConfig.mode = 'specific'
I0108 02:10:51.557881 140411627080768 gin_utils.py:88] utils.RestoreCheckpointConfig.path = %CHECKPOINT_PATH
I0108 02:10:51.557913 140411627080768 gin_utils.py:88]
I0108 02:10:51.557946 140411627080768 gin_utils.py:88] # Parameters for seqio.SentencePieceVocabulary:
I0108 02:10:51.557979 140411627080768 gin_utils.py:88] # ==============================================================================
I0108 02:10:51.558012 140411627080768 gin_utils.py:88] seqio.SentencePieceVocabulary.sentencepiece_model_file = \
I0108 02:10:51.558044 140411627080768 gin_utils.py:88] 'gs://t5-data/vocabs/cc_all.32000.100extra/sentencepiece.model'
I0108 02:10:51.558077 140411627080768 gin_utils.py:88]
I0108 02:10:51.558110 140411627080768 gin_utils.py:88] # Parameters for network.T5Config:
I0108 02:10:51.558142 140411627080768 gin_utils.py:88] # ==============================================================================
I0108 02:10:51.558175 140411627080768 gin_utils.py:88] network.T5Config.dropout_rate = %DROPOUT_RATE
I0108 02:10:51.558208 140411627080768 gin_utils.py:88] network.T5Config.dtype = 'bfloat16'
I0108 02:10:51.558241 140411627080768 gin_utils.py:88] network.T5Config.emb_dim = 768
I0108 02:10:51.558292 140411627080768 gin_utils.py:88] network.T5Config.head_dim = 64
I0108 02:10:51.558327 140411627080768 gin_utils.py:88] network.T5Config.logits_via_embedding = False
I0108 02:10:51.558362 140411627080768 gin_utils.py:88] network.T5Config.mlp_activations = ('gelu', 'linear')
I0108 02:10:51.558396 140411627080768 gin_utils.py:88] network.T5Config.mlp_dim = 2048
I0108 02:10:51.558431 140411627080768 gin_utils.py:88] network.T5Config.num_decoder_layers = 12
I0108 02:10:51.558466 140411627080768 gin_utils.py:88] network.T5Config.num_encoder_layers = 12
I0108 02:10:51.558501 140411627080768 gin_utils.py:88] network.T5Config.num_heads = 12
I0108 02:10:51.558536 140411627080768 gin_utils.py:88] network.T5Config.vocab_size = 32128
I0108 02:10:51.558570 140411627080768 gin_utils.py:88]
I0108 02:10:51.558605 140411627080768 gin_utils.py:88] # Parameters for network.Transformer:
I0108 02:10:51.558650 140411627080768 gin_utils.py:88] # ==============================================================================
I0108 02:10:51.558696 140411627080768 gin_utils.py:88] network.Transformer.config = @network.T5Config()
Traceback (most recent call last):
File "/usr/lib/python3.9/runpy.py", line 197, in _run_module_as_main
return _run_code(code, main_globals, None,
File "/usr/lib/python3.9/runpy.py", line 87, in _run_code
exec(code, run_globals)
File "/home/yujonglee/t5x/t5x/eval.py", line 355, in
gin_utils.run(main)
File "/home/yujonglee/t5x/t5x/gin_utils.py", line 130, in run
app.run(
File "/home/yujonglee/t5_venv/lib/python3.9/site-packages/absl/app.py", line 308, in run
_run_main(main, args)
File "/home/yujonglee/t5_venv/lib/python3.9/site-packages/absl/app.py", line 254, in _run_main
sys.exit(main(argv))
File "/home/yujonglee/t5x/t5x/eval.py", line 335, in main
_main(argv)
File "/home/yujonglee/t5x/t5x/eval.py", line 353, in _main
evaluate_using_gin()
File "/home/yujonglee/t5_venv/lib/python3.9/site-packages/gin/config.py", line 1605, in gin_wrapper
utils.augment_exception_message_and_reraise(e, err_str)
File "/home/yujonglee/t5_venv/lib/python3.9/site-packages/gin/utils.py", line 41, in augment_exception_message_and_reraise
raise proxy.with_traceback(exception.__traceback__) from None
File "/home/yujonglee/t5_venv/lib/python3.9/site-packages/gin/config.py", line 1582, in gin_wrapper
return fn(*new_args, **new_kwargs)
TypeError: evaluate() missing 1 required keyword-only argument: 'partitioner'
In call to configurable 'evaluate' ()

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.