Why newfc extend AttModel?
See original GitHub issueThank 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:
- Created 4 years ago
- Comments:7 (4 by maintainers)
Top 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 >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
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.
replace l770 in AttModel.py with return fc_feats, att_feats, att_feats, att_masks.
I fixed it locally.