question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Why newfc extend AttModel?

See original GitHub issue

Thank you for your repo, Here is my question when I eval newfc, there is some error

tmp_att_feats = p_att_feats[k:k+1].expand(*((beam_size,)+p_att_feats.size()[1:])).contiguous()
TypeError: 'NoneType' object has no attribute '__getitem__'

and I found that newfc extends AttModel, but in initialization, we do not read att feats for newfc as in misc.utils.py

def if_use_feat(caption_model):
    # Decide if load attention feature according to caption model
    if caption_model in ['show_tell', 'all_img', 'fc', 'newfc']:
        use_att, use_fc = False, True
    elif caption_model == 'language_model':
        use_att, use_fc = False, False
    elif caption_model in ['topdown', 'adaatt','stackatt','denseatt','adaattmo']:
        use_fc, use_att = True, True
    else:
        use_att, use_fc = True, False
    return use_fc, use_att

So could you please tell me why newfc extend AttModel ?

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:7 (4 by maintainers)

github_iconTop GitHub Comments

4reactions
ruotianluocommented, Sep 20, 2019

Basically treat fc model as a special case of attmodel where there is no attention.

So that the fc model can reuse all the functions of attmodel. Basically to reduce redundant code.

1reaction
ruotianluocommented, Sep 20, 2019

replace l770 in AttModel.py with return fc_feats, att_feats, att_feats, att_masks.

I fixed it locally.

Read more comments on GitHub >

github_iconTop Results From Across the Web

add files · NAACL2022/CLIP-Caption-Reward at c80917c
AttModel import pack_wrapper, AttModel, Attention ... + tmp_fc_feats = [fc_feats[i][k:k+1].expand(beam_size, ... + print('Use newfc instead of fc').
Read more >
Multipurpose AC to DC Adapters - PicClick
Extension Cable Length 1.5m. Plug Type EU. Outlet : 2 AC outlets plugs +4 USB ports. SII WA-36A12 Power Supply · 6v Ac...
Read more >
Unofficial pytorch implementation for Self-critical Sequence ...
Beam Search. Beam search can increase the performance of the search for greedy decoding sequence by ~5%. However, this is a little more ......
Read more >
Unofficial pytorch implementation for Self ... - PythonRepo
python tools/train.py --id fc --caption_model newfc --input_json ... Beam search can increase the performance of the search for greedy decoding sequence by ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found