Giter Club home page Giter Club logo

Comments (6)

FFYYang avatar FFYYang commented on May 20, 2024

I encountered the same problem, how did you fix the 1st error?
TypeError: sequence item 89: expected str instance, bytes found

from albert.

ntedgi avatar ntedgi commented on May 20, 2024

i have the same problem also

@YasinQiu
just add a quick and dirty fix
run_squad_sp.py line 381

            for i in range(len(para_tokens)):
                if type(para_tokens[i]) != str:
                    para_tokens[i] = str(para_tokens[i], 'utf-8')

my full run log :

WARNING:tensorflow:From /home/naort/Desktop/Algorithem/ALBERT/lamb_optimizer.py:33: The name tf.train.Optimizer is deprecated. Please use tf.compat.v1.train.Optimizer instead.

WARNING:tensorflow:From /home/naort/Desktop/Algorithem/ALBERT/run_squad_sp.py:1333: The name tf.app.run is deprecated. Please use tf.compat.v1.app.run instead.

WARNING:tensorflow:From /home/naort/Desktop/Algorithem/ALBERT/run_squad_sp.py:1166: The name tf.logging.set_verbosity is deprecated. Please use tf.compat.v1.logging.set_verbosity instead.

W1210 13:40:15.465523 140706780804928 module_wrapper.py:139] From /home/naort/Desktop/Algorithem/ALBERT/run_squad_sp.py:1166: The name tf.logging.set_verbosity is deprecated. Please use tf.compat.v1.logging.set_verbosity instead.

WARNING:tensorflow:From /home/naort/Desktop/Algorithem/ALBERT/run_squad_sp.py:1166: The name tf.logging.INFO is deprecated. Please use tf.compat.v1.logging.INFO instead.

W1210 13:40:15.465772 140706780804928 module_wrapper.py:139] From /home/naort/Desktop/Algorithem/ALBERT/run_squad_sp.py:1166: The name tf.logging.INFO is deprecated. Please use tf.compat.v1.logging.INFO instead.

WARNING:tensorflow:From /home/naort/Desktop/Algorithem/ALBERT/modeling.py:115: The name tf.gfile.GFile is deprecated. Please use tf.io.gfile.GFile instead.

W1210 13:40:15.466036 140706780804928 module_wrapper.py:139] From /home/naort/Desktop/Algorithem/ALBERT/modeling.py:115: The name tf.gfile.GFile is deprecated. Please use tf.io.gfile.GFile instead.

WARNING:tensorflow:From /home/naort/Desktop/Algorithem/ALBERT/run_squad_sp.py:1172: The name tf.gfile.MakeDirs is deprecated. Please use tf.io.gfile.makedirs instead.

W1210 13:40:15.467275 140706780804928 module_wrapper.py:139] From /home/naort/Desktop/Algorithem/ALBERT/run_squad_sp.py:1172: The name tf.gfile.MakeDirs is deprecated. Please use tf.io.gfile.makedirs instead.

WARNING:tensorflow:From /home/naort/Desktop/Algorithem/ALBERT/tokenization.py:239: The name tf.logging.info is deprecated. Please use tf.compat.v1.logging.info instead.

W1210 13:40:15.467582 140706780804928 module_wrapper.py:139] From /home/naort/Desktop/Algorithem/ALBERT/tokenization.py:239: The name tf.logging.info is deprecated. Please use tf.compat.v1.logging.info instead.

INFO:tensorflow:loading sentence piece model
I1210 13:40:15.467732 140706780804928 tokenization.py:239] loading sentence piece model
WARNING:tensorflow:From /home/naort/Desktop/Algorithem/ALBERT/run_squad_sp.py:260: The name tf.gfile.Open is deprecated. Please use tf.io.gfile.GFile instead.

W1210 13:40:15.547182 140706780804928 module_wrapper.py:139] From /home/naort/Desktop/Algorithem/ALBERT/run_squad_sp.py:260: The name tf.gfile.Open is deprecated. Please use tf.io.gfile.GFile instead.

WARNING:tensorflow:Estimator's model_fn (<function model_fn_builder..model_fn at 0x7ff89d53eb90>) includes params argument, but params are not passed to Estimator.
W1210 13:40:17.235064 140706780804928 estimator.py:1994] Estimator's model_fn (<function model_fn_builder..model_fn at 0x7ff89d53eb90>) includes params argument, but params are not passed to Estimator.
INFO:tensorflow:Using config: {'_model_dir': 'data/output', '_tf_random_seed': None, '_save_summary_steps': 100, '_save_checkpoints_steps': 1000, '_save_checkpoints_secs': None, '_session_config': allow_soft_placement: true
graph_options {
rewrite_options {
meta_optimizer_iterations: ONE
}
}
, '_keep_checkpoint_max': 5, '_keep_checkpoint_every_n_hours': 10000, '_log_step_count_steps': None, '_train_distribute': None, '_device_fn': None, '_protocol': None, '_eval_distribute': None, '_experimental_distribute': None, '_experimental_max_worker_delay_secs': None, '_session_creation_timeout_secs': 7200, '_service': None, '_cluster_spec': <tensorflow.python.training.server_lib.ClusterSpec object at 0x7ff8957b2790>, '_task_type': 'worker', '_task_id': 0, '_global_id_in_cluster': 0, '_master': '', '_evaluation_master': '', '_is_chief': True, '_num_ps_replicas': 0, '_num_worker_replicas': 1, '_tpu_config': TPUConfig(iterations_per_loop=1000, num_shards=8, num_cores_per_replica=None, per_host_input_for_training=3, tpu_job_name=None, initial_infeed_sleep_secs=None, input_partition_dims=None, eval_training_input_configuration=2, experimental_host_call_every_n_steps=1), '_cluster': None}
I1210 13:40:17.236501 140706780804928 estimator.py:212] Using config: {'_model_dir': 'data/output', '_tf_random_seed': None, '_save_summary_steps': 100, '_save_checkpoints_steps': 1000, '_save_checkpoints_secs': None, '_session_config': allow_soft_placement: true
graph_options {
rewrite_options {
meta_optimizer_iterations: ONE
}
}
, '_keep_checkpoint_max': 5, '_keep_checkpoint_every_n_hours': 10000, '_log_step_count_steps': None, '_train_distribute': None, '_device_fn': None, '_protocol': None, '_eval_distribute': None, '_experimental_distribute': None, '_experimental_max_worker_delay_secs': None, '_session_creation_timeout_secs': 7200, '_service': None, '_cluster_spec': <tensorflow.python.training.server_lib.ClusterSpec object at 0x7ff8957b2790>, '_task_type': 'worker', '_task_id': 0, '_global_id_in_cluster': 0, '_master': '', '_evaluation_master': '', '_is_chief': True, '_num_ps_replicas': 0, '_num_worker_replicas': 1, '_tpu_config': TPUConfig(iterations_per_loop=1000, num_shards=8, num_cores_per_replica=None, per_host_input_for_training=3, tpu_job_name=None, initial_infeed_sleep_secs=None, input_partition_dims=None, eval_training_input_configuration=2, experimental_host_call_every_n_steps=1), '_cluster': None}
INFO:tensorflow:_TPUContext: eval_on_tpu True
I1210 13:40:17.236908 140706780804928 tpu_context.py:220] _TPUContext: eval_on_tpu True
WARNING:tensorflow:eval_on_tpu ignored because use_tpu is False.
W1210 13:40:17.237115 140706780804928 tpu_context.py:222] eval_on_tpu ignored because use_tpu is False.
WARNING:tensorflow:From /home/naort/Desktop/Algorithem/ALBERT/run_squad_sp.py:1231: The name tf.gfile.Exists is deprecated. Please use tf.io.gfile.exists instead.

W1210 13:40:17.237350 140706780804928 module_wrapper.py:139] From /home/naort/Desktop/Algorithem/ALBERT/run_squad_sp.py:1231: The name tf.gfile.Exists is deprecated. Please use tf.io.gfile.exists instead.

WARNING:tensorflow:From /home/naort/Desktop/Algorithem/ALBERT/run_squad_sp.py:1104: The name tf.python_io.TFRecordWriter is deprecated. Please use tf.io.TFRecordWriter instead.

W1210 13:40:17.237722 140706780804928 module_wrapper.py:139] From /home/naort/Desktop/Algorithem/ALBERT/run_squad_sp.py:1104: The name tf.python_io.TFRecordWriter is deprecated. Please use tf.io.TFRecordWriter instead.

INFO:tensorflow:Converting 0/130319 pos 0 neg 0
I1210 13:40:17.241458 140706780804928 run_squad_sp.py:352] Converting 0/130319 pos 0 neg 0
INFO:tensorflow:*** Example ***
I1210 13:40:17.393134 140706780804928 run_squad_sp.py:587] *** Example ***
INFO:tensorflow:unique_id: 1000000000
I1210 13:40:17.393342 140706780804928 run_squad_sp.py:588] unique_id: 1000000000
INFO:tensorflow:example_index: 0
I1210 13:40:17.393471 140706780804928 run_squad_sp.py:589] example_index: 0
INFO:tensorflow:doc_span_index: 0
I1210 13:40:17.393594 140706780804928 run_squad_sp.py:590] doc_span_index: 0
INFO:tensorflow:tok_start_to_orig_index: 0 4 5 6 10 14 21 23 31 39 42 50 57 66 71 75 86 94 105 113 117 121 129 130 131 138 143 147 152 156 163 174 175 179 190 195 203 206 214 217 230 236 240 247 257 260 266 273 274 277 285 286 294 306 307 314 320 321 323 330 335 341 349 361 365 374 375 379 385 388 396 400 410 414 425 427 431 442 447 450 455 456 460 465 469 478 483 492 495 503 512 513 517 529 532 535 538 541 544 548 553 554 555 571 575 579 591 594 606
I1210 13:40:17.393762 140706780804928 run_squad_sp.py:592] tok_start_to_orig_index: 0 4 5 6 10 14 21 23 31 39 42 50 57 66 71 75 86 94 105 113 117 121 129 130 131 138 143 147 152 156 163 174 175 179 190 195 203 206 214 217 230 236 240 247 257 260 266 273 274 277 285 286 294 306 307 314 320 321 323 330 335 341 349 361 365 374 375 379 385 388 396 400 410 414 425 427 431 442 447 450 455 456 460 465 469 478 483 492 495 503 512 513 517 529 532 535 538 541 544 548 553 554 555 571 575 579 591 594 606
INFO:tensorflow:tok_end_to_orig_index: 3 4 5 9 13 20 22 30 38 41 49 56 65 70 74 85 93 104 112 116 120 128 129 130 137 142 146 151 155 162 173 174 178 189 194 202 205 213 216 229 235 239 246 256 259 265 272 273 276 284 285 293 305 306 313 319 320 322 329 334 340 348 360 364 373 374 378 384 387 395 399 409 413 424 426 430 441 446 449 454 455 459 464 468 477 482 491 494 502 511 512 516 528 531 534 537 540 543 547 552 553 554 570 574 578 590 593 605 606
I1210 13:40:17.393929 140706780804928 run_squad_sp.py:594] tok_end_to_orig_index: 3 4 5 9 13 20 22 30 38 41 49 56 65 70 74 85 93 104 112 116 120 128 129 130 137 142 146 151 155 162 173 174 178 189 194 202 205 213 216 229 235 239 246 256 259 265 272 273 276 284 285 293 305 306 313 319 320 322 329 334 340 348 360 364 373 374 378 384 387 395 399 409 413 424 426 430 441 446 449 454 455 459 464 468 477 482 491 494 502 511 512 516 528 531 534 537 540 543 547 552 553 554 570 574 578 590 593 605 606
INFO:tensorflow:token_is_max_context: 28:True 29:True 30:True 31:True 32:True 33:True 34:True 35:True 36:True 37:True 38:True 39:True 40:True 41:True 42:True 43:True 44:True 45:True 46:True 47:True 48:True 49:True 50:True 51:True 52:True 53:True 54:True 55:True 56:True 57:True 58:True 59:True 60:True 61:True 62:True 63:True 64:True 65:True 66:True 67:True 68:True 69:True 70:True 71:True 72:True 73:True 74:True 75:True 76:True 77:True 78:True 79:True 80:True 81:True 82:True 83:True 84:True 85:True 86:True 87:True 88:True 89:True 90:True 91:True 92:True 93:True 94:True 95:True 96:True 97:True 98:True 99:True 100:True 101:True 102:True 103:True 104:True 105:True 106:True 107:True 108:True 109:True 110:True 111:True 112:True 113:True 114:True 115:True 116:True 117:True 118:True 119:True 120:True 121:True 122:True 123:True 124:True 125:True 126:True 127:True 128:True 129:True 130:True 131:True 132:True 133:True 134:True 135:True 136:True
I1210 13:40:17.394106 140706780804928 run_squad_sp.py:596] token_is_max_context: 28:True 29:True 30:True 31:True 32:True 33:True 34:True 35:True 36:True 37:True 38:True 39:True 40:True 41:True 42:True 43:True 44:True 45:True 46:True 47:True 48:True 49:True 50:True 51:True 52:True 53:True 54:True 55:True 56:True 57:True 58:True 59:True 60:True 61:True 62:True 63:True 64:True 65:True 66:True 67:True 68:True 69:True 70:True 71:True 72:True 73:True 74:True 75:True 76:True 77:True 78:True 79:True 80:True 81:True 82:True 83:True 84:True 85:True 86:True 87:True 88:True 89:True 90:True 91:True 92:True 93:True 94:True 95:True 96:True 97:True 98:True 99:True 100:True 101:True 102:True 103:True 104:True 105:True 106:True 107:True 108:True 109:True 110:True 111:True 112:True 113:True 114:True 115:True 116:True 117:True 118:True 119:True 120:True 121:True 122:True 123:True 124:True 125:True 126:True 127:True 128:True 129:True 130:True 131:True 132:True 133:True 134:True 135:True 136:True
INFO:tensorflow:input_pieces: [CLS] ▁what ▁is ▁the ▁name ▁of ▁the ▁act ▁that ▁was ▁a ▁success ▁in ▁creating ▁boundaries ▁for ▁the ▁crown ▁and ▁the ▁ e ic ▁for ▁being ▁subjective ? [SEP] ▁pitt ' s ▁act ▁was ▁deemed ▁a ▁failure ▁because ▁it ▁quickly ▁became ▁apparent ▁that ▁the ▁boundaries ▁between ▁government ▁control ▁and ▁the ▁company ' s ▁powers ▁were ▁neb ulous ▁and ▁highly ▁subjective . ▁the ▁government ▁felt ▁obliged ▁to ▁respond ▁to ▁humanitarian ▁calls ▁for ▁better ▁treatment ▁of ▁local ▁people s ▁in ▁british - occupied ▁territories . ▁edmund ▁burke , ▁a ▁former ▁east ▁india ▁company ▁shareholder ▁and ▁diplomat , ▁was ▁moved ▁to ▁address ▁the ▁situation ▁and ▁introduced ▁a ▁new ▁regulating ▁bill ▁in ▁1783 . ▁the ▁bill ▁was ▁defeated ▁amid ▁lobbying ▁by ▁company ▁loyalist s ▁and ▁accusations ▁of ▁ne pot ism ▁in ▁the ▁bill ' s ▁recommendations ▁for ▁the ▁appointment ▁of ▁councillors . [SEP]
I1210 13:40:17.394688 140706780804928 run_squad_sp.py:599] input_pieces: [CLS] ▁what ▁is ▁the ▁name ▁of ▁the ▁act ▁that ▁was ▁a ▁success ▁in ▁creating ▁boundaries ▁for ▁the ▁crown ▁and ▁the ▁ e ic ▁for ▁being ▁subjective ? [SEP] ▁pitt ' s ▁act ▁was ▁deemed ▁a ▁failure ▁because ▁it ▁quickly ▁became ▁apparent ▁that ▁the ▁boundaries ▁between ▁government ▁control ▁and ▁the ▁company ' s ▁powers ▁were ▁neb ulous ▁and ▁highly ▁subjective . ▁the ▁government ▁felt ▁obliged ▁to ▁respond ▁to ▁humanitarian ▁calls ▁for ▁better ▁treatment ▁of ▁local ▁people s ▁in ▁british - occupied ▁territories . ▁edmund ▁burke , ▁a ▁former ▁east ▁india ▁company ▁shareholder ▁and ▁diplomat , ▁was ▁moved ▁to ▁address ▁the ▁situation ▁and ▁introduced ▁a ▁new ▁regulating ▁bill ▁in ▁1783 . ▁the ▁bill ▁was ▁defeated ▁amid ▁lobbying ▁by ▁company ▁loyalist s ▁and ▁accusations ▁of ▁ne pot ism ▁in ▁the ▁bill ' s ▁recommendations ▁for ▁the ▁appointment ▁of ▁councillors . [SEP]

from albert.

zheyuye avatar zheyuye commented on May 20, 2024

@ntedgi the new lines fix the type bug on SQuAD2.0 remain the "list index out of range" for SQuAD1.1

from albert.

s4sarath avatar s4sarath commented on May 20, 2024
        para_tokens = [six.ensure_text(token, "utf-8") for token in para_tokens]

Add the above line after line number 363 https://github.com/google-research/ALBERT/blob/master/run_squad_sp.py#L363 .

After that comment line number 374 https://github.com/google-research/ALBERT/blob/master/run_squad_sp.py#L374 ( frist line after the for loop )

from albert.

Danny-Google avatar Danny-Google commented on May 20, 2024

The bug has been fixed. We also added early stopping. Please let us know if you encounter any further problems.

from albert.

freefuiiismyname avatar freefuiiismyname commented on May 20, 2024

@Danny-Google
Thank you for your work on this issue.I've tried to run the albert-base.I made the following slight changes,it does work now.

with change line 29 in run_squad_v2.py.
from garcon.albert import squad_utils  ——> import squad_utils

with del line 20 in squad_utils.py
from __future__ import google_type_annotations

Thank you for your effort again! ^ ^

from albert.

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.