Comments (8)
This is because I didn't consider situation when language_eval is false. You can comment this line put.
from imagecaptioning.pytorch.
Thanks! It's work
from imagecaptioning.pytorch.
sorry. I met the same question ,but I don't know how to fix it
from imagecaptioning.pytorch.
@makaaay check my reply above.
from imagecaptioning.pytorch.
emmmm,comment " assert args.language_eval == 0 or args.language_eval == 1" in opts.py ? sorry,I am a new learner in Shanghai.
from imagecaptioning.pytorch.
comment out line 152 and line 153 in train.py
from imagecaptioning.pytorch.
yeah~it works now !
my mate help me in lines150-161.
if tf is not None and isinstance(lang_stats, dict):
add_summary_value(tf_summary_writer, 'validation loss', val_loss, iteration)
for k,v in lang_stats.items():
add_summary_value(tf_summary_writer, k, v, iteration)
tf_summary_writer.flush()
val_result_history[iteration] = {'loss': val_loss, 'lang_stats': lang_stats, 'predictions': predictions}
# Save model if is improving on validation result
if opt.language_eval == 1 and isinstance(lang_stats, dict):
current_score = lang_stats['CIDEr']
else:
current_score = - val_loss
it also works!
thank you very much ! happy new year in US and have a bright future in phd.
from imagecaptioning.pytorch.
@weiweili123 Hi, It seems that you have successfully run @ruotianluo 's code, but I got such an Error as followed, can you give me some help or advice? Thank you very much.
DataLoader loading json file: ./data/cocotalk.json
vocab size is 9487
DataLoader loading h5 file: ./data/cocotalk_fc ./data/cocotalk_att ./data/cocotalk_label.h5
max sequence length in data is 20
read 123287 image features
assigned 113287 images to split train
assigned 5000 images to split val
assigned 5000 images to split test
F:\Miniconda\lib\site-packages\torch\nn\modules\rnn.py:54: UserWarning: dropout option adds dropout after all but last recurrent layer, so non-zero dropout expects num_layers greater than 1, but got dropout=0.5 and num_layers=1
"num_layers={}".format(dropout, num_layers))
Traceback (most recent call last):
File "F:/Research/ImageCaptioning.pytorch-master/train.py", line 211, in
train(opt)
File "F:/Research/ImageCaptioning.pytorch-master/train.py", line 105, in train
data = loader.get_batch('train')
File "F:\Research\ImageCaptioning.pytorch-master\dataloader.py", line 135, in get_batch
ix, tmp_wrapped = self._prefetch_process[split].get()
File "F:\Research\ImageCaptioning.pytorch-master\dataloader.py", line 263, in get
self.reset()
File "F:\Research\ImageCaptioning.pytorch-master\dataloader.py", line 242, in reset
collate_fn=lambda x: x[0]))
File "F:\Miniconda\lib\site-packages\torch\utils\data\dataloader.py", line 193, in iter
return _DataLoaderIter(self)
File "F:\Miniconda\lib\site-packages\torch\utils\data\dataloader.py", line 469, in init
w.start()
File "F:\Miniconda\lib\multiprocessing\process.py", line 105, in start
self._popen = self._Popen(self)
File "F:\Miniconda\lib\multiprocessing\context.py", line 223, in _Popen
return _default_context.get_context().Process._Popen(process_obj)
File "F:\Miniconda\lib\multiprocessing\context.py", line 322, in _Popen
return Popen(process_obj)
File "F:\Miniconda\lib\multiprocessing\popen_spawn_win32.py", line 65, in init
reduction.dump(process_obj, to_child)
File "F:\Miniconda\lib\multiprocessing\reduction.py", line 60, in dump
ForkingPickler(file, protocol).dump(obj)
AttributeError: Can't pickle local object 'BlobFetcher.reset..'
Terminating BlobFetcher
Traceback (most recent call last):
File "", line 1, in
File "F:\Miniconda\lib\multiprocessing\spawn.py", line 105, in spawn_main
exitcode = _main(fd)
File "F:\Miniconda\lib\multiprocessing\spawn.py", line 115, in _main
self = reduction.pickle.load(from_parent)
EOFError: Ran out of input <
from imagecaptioning.pytorch.
Related Issues (20)
- 应用其他数据集的问题 HOT 2
- cannot import name 'Final' from 'typing'
- ImportError
- Karpathy划分的MSCOCO测试集图片 HOT 1
- 关于config的许多疑问 HOT 2
- How to extract feature ATT features from one's own dataset HOT 1
- 获取dataset_coco.json的页面404 not found HOT 3
- Can I extract features using other pertained models except resnet? HOT 2
- 获取dataset_coco.json的页面404 not found
- No such file or directory: 'data/coco-train-idxs.p' HOT 1
- 关于train use self-critical HOT 4
- 关于特征提取bottom-up HOT 5
- missing the module or attribute `_C` in the maskrcnn_benchmark package your calling in your notebook
- 关于cocobu测试时遇到的问题 HOT 2
- 关于其它模型在colab上使用的问题 HOT 1
- Image
- 在模型中有structure_after的参数,这是指在structure_after之前模型训练用cross-entropy,之后用的是CIDEr optimization一类的吗 HOT 1
- Cannot load file containing pickled data when allow_pickle=False
- UnboundLocalError: local variable 'gt_indices' referenced before assignment
- 词嵌入问题 HOT 5
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from imagecaptioning.pytorch.