Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FashionBert errors #22

Closed
StefanoSalvatori opened this issue Dec 2, 2020 · 0 comments
Closed

FashionBert errors #22

StefanoSalvatori opened this issue Dec 2, 2020 · 0 comments

Comments

@StefanoSalvatori
Copy link

StefanoSalvatori commented Dec 2, 2020

I tried to run the scripts provided for fashionbert and i'm getting this error:

Traceback (most recent call last):
  File "pretrain_main.py", line 194, in <module>
    main()
  File "pretrain_main.py", line 177, in main
    yield_single_examples=False):
  File "/usr/local/lib/python3.6/dist-packages/tensorflow/python/estimator/estimator.py", line 577, in predict
    features, None, model_fn_lib.ModeKeys.PREDICT, self.config)
  File "/usr/local/lib/python3.6/dist-packages/tensorflow/python/estimator/estimator.py", line 1195, in _call_model_fn
     model_fn_results = self._model_fn(features=features, **kwargs)
  File "/usr/local/lib/python3.6/dist-packages/easytransfer/engines/model.py", line 578, in model_fn
    output = self.build_logits(features, mode=mode)
  File "pretrain_main.py", line 50, in build_logits
    input_sequence_length=_APP_FLAGS.input_sequence_length)
  File "/usr/local/lib/python3.6/dist-packages/easytransfer/model_zoo/__init__.py", line 38, in get_pretrained_model
     return ImageBertPreTrainedModel.get(pretrain_model_name_or_path, **kwargs)
  File "/usr/local/lib/python3.6/dist-packages/easytransfer/model_zoo/modeling_utils.py", line 99, in get
    model(model.dummy_inputs(kwargs.get('input_sequence_length', 512)), mode='eval', output_features=False)
  File "/usr/local/lib/python3.6/dist-packages/easytransfer/model_zoo/modeling_utils.py", line 69, in dummy_inputs
    input_ids = [[1]*seq_length]
  TypeError: can't multiply sequence by non-int of type 'NoneType'

After running:

python3 pretrain_main.py \
  --workerGPU=1 \
  --type=txt2img  \
  --mode=predict \
  --predict_input_fp=eval_txt2img_list.list_csv  \
  --predict_batch_size=64  \
  --output_dir=./fashionbert_out  \
  --pretrain_model_name_or_path=./pai-imagebert-base-en/model.ckpt  \
  --predict_checkpoint_path=./fashionbert_pretrain_model_fin/model.ckpt-54198  \
  --image_feature_size=131072  \
  --input_schema="image_feature:float:131072,image_mask:int:64,input_ids:int:64,input_mask:int:64,segment_ids:int:64,nx_sent_labels:int:1,prod_desc:str:1,text_prod_id:str:1,image_prod_id:str:1,prod_img_id:str:1"  \

I'm using easytransfer 0.1.2 (since the latest version causes another error as reported here #21) and tensorflow 1.12.3.

Can you give some advice on how to run the scripts? Are there other implementation of FashionBert (pytorch or tensorflow?)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant