-
Notifications
You must be signed in to change notification settings - Fork 9
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
Problem of load pre-trained model. #1
Comments
The resnet baseline refers to models from
https://github.com/gsig/charades-algorithms
Download the following and update the path:
https://www.dropbox.com/s/iy9fmk0r1a3edoz/resnet_rgb.pth.tar?dl=1
Hope that helps!
…On Thu, Jun 21, 2018, 2:45 PM Happsky ***@***.***> wrote:
The command I used is python baseline_resnet152charades.py.
Thank you in advance!
=> using pre-trained model 'resnet152'
loading pretrained-weights from
/nfs.yoda/gsigurds/charades_pretrained/resnet_rgb.pth.tar
Traceback (most recent call last):
File "baseline_resnet152charades.py", line 38, in
main()
File "./main.py", line 60, in main
model, criterion, optimizer = create_model(args)
File "./models/*init*.py", line 10, in create_model
model = load_architecture(args)
File "./models/utils.py", line 78, in load_architecture
model = generic_load(args.arch, args.pretrained, args.pretrained_weights,
args)
File "./models/utils.py", line 61, in generic_load
model = model.*dict*arch <http://args>
File "./models/ActorObserverBase.py", line 55, in *init*
model = load_sub_architecture(args)
File "./models/utils.py", line 73, in load_sub_architecture
model = generic_load(args.subarch, args.pretrained,
args.pretrained_subweights, args)
File "./models/utils.py", line 65, in generic_load
chkpoint = torch.load(weights)
File
"/home/csdept/anaconda3/envs/py27/lib/python2.7/site-packages/torch/serialization.py",
line 301, in load
f = open(f, 'rb')
IOError: [Errno 2] No such file or directory:
'/nfs.yoda/gsigurds/charades_pretrained/resnet_rgb.pth.tar'
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#1>, or mute the thread
<https://github.com/notifications/unsubscribe-auth/ADbmNW4K1HdilvHf9Vz8RsA4s9Xee-obks5t_AXagaJpZM4UyvSs>
.
|
Thanks for your quick reply, after downloading the pre-trained model, I meet another problem as follows. cachefile ./caches/baseline_resnet152charades//CharadesEgo_train.pkl
|
It seems that the code is unable to load in the Charades frames. Have you double checked the directories for the rgb frames? I recommend setting the --cache-buster flag to tell the code to ignore the "empty" cache it has generated. Let me know if you have any questions! |
Thanks for your response! Now baseline_resnet152charades.py, baseline_resnet152imagenet.py and third_to_first_person.py worked for me, while when I run the comment cachefile ./caches/alignment_and_zeroshot//CharadesEgo_train.pkl
And I double-check the paths, I think they are all correct. Do you have any suggestions? |
The problem is below, it's not finding the original charades folder, make
sure you have downloaded the original charades dataset as well and updated
the path accordingly.
Hope that helps. Let me know if that works.
cachefile ./caches/alignment_and_zeroshot//CharadesEgoPlusRGB_train.pkl
Loading cached result from './caches/alignment_and_
zeroshot//CharadesEgoPlusRGB_train.pkl'
0 samples loaded
cachefile ./caches/alignment_and_zeroshot//CharadesEgoPlusRGB_val.pkl
Loading cached result from './caches/alignment_and_
zeroshot//CharadesEgoPlusRGB_val.pkl'
0 samples loaded
cachefile ./caches/alignment_and_zeroshot//CharadesEgoPlusRGB_val_video.pkl
Loading cached result from './caches/alignment_and_
zeroshot//CharadesEgoPlusRGB_val_video.pkl'
0 samples loaded
…On Sun, Jul 1, 2018, 11:01 PM Happsky ***@***.***> wrote:
Thanks for your response! Now baseline_resnet152charades.py,
baseline_resnet152imagenet.py and third_to_first_person.py worked for me,
while when I run the comment python alignment_and_zeroshot.py, it occurs
the following error,
cachefile ./caches/alignment_and_zeroshot//CharadesEgo_train.pkl
Loading cached result from
'./caches/alignment_and_zeroshot//CharadesEgo_train.pkl'
425450 samples loaded
cachefile ./caches/alignment_and_zeroshot//CharadesEgo_val.pkl
Loading cached result from
'./caches/alignment_and_zeroshot//CharadesEgo_val.pkl'
111643 samples loaded
cachefile ./caches/alignment_and_zeroshot//CharadesEgo_val_video.pkl
Loading cached result from
'./caches/alignment_and_zeroshot//CharadesEgo_val_video.pkl'
0 samples loaded
cachefile ./caches/alignment_and_zeroshot//CharadesEgoPlusRGB_train.pkl
Loading cached result from
'./caches/alignment_and_zeroshot//CharadesEgoPlusRGB_train.pkl'
0 samples loaded
cachefile ./caches/alignment_and_zeroshot//CharadesEgoPlusRGB_val.pkl
Loading cached result from
'./caches/alignment_and_zeroshot//CharadesEgoPlusRGB_val.pkl'
0 samples loaded
cachefile ./caches/alignment_and_zeroshot//CharadesEgoPlusRGB_val_video.pkl
Loading cached result from
'./caches/alignment_and_zeroshot//CharadesEgoPlusRGB_val_video.pkl'
0 samples loaded
cachefile ./caches/alignment_and_zeroshot//CharadesMeta_val_video.pkl
Loading cached result from
'./caches/alignment_and_zeroshot//CharadesMeta_val_video.pkl'
2425 samples loaded
fc7 norms: 49.0615310669 48.3031234741 49.2480506897
pairwise dist means: 14.2884759903 13.5230617523
scales:0.499999999048 0.499999999048 0.499999999048
./models/layers/ActorObserverLossAllWithClassifier.py:21: UserWarning:
volatile was removed (Variable.volatile is always False)
if not cls.volatile:
./models/layers/ActorObserverLossAllWithClassifier.py:24: UserWarning:
invalid index of a 0-dim tensor. This will be an error in PyTorch 0.5. Use
tensor.item() to convert a 0-dim tensor to a Python number
inds1 = [i for i, t in enumerate(target) if t.data[0] > 0]
./models/layers/ActorObserverLossAllWithClassifier.py:25: UserWarning:
invalid index of a 0-dim tensor. This will be an error in PyTorch 0.5. Use
tensor.item() to convert a 0-dim tensor to a Python number
inds2 = [i for i, t in enumerate(target) if not t.data[0] > 0]
#triplets: 4 #class: 0
./models/layers/VideoSoftmax.py:37: UserWarning: invalid index of a 0-dim
tensor. This will be an error in PyTorch 0.5. Use tensor.item() to convert
a 0-dim tensor to a Python number
self.storage[vid] = x.data[0]
./models/layers/ActorObserverLoss.py:38: UserWarning: invalid index of a
0-dim tensor. This will be an error in PyTorch 0.5. Use tensor.item() to
convert a 0-dim tensor to a Python number
x, w = x.data[0], w.data[0]
loss before 4.94595146179
loss after 4.94593954086
weight median: 1.0, var: 0.0
/opt/conda/conda-bld/pytorch_1524577177097/work/aten/src/THCUNN/ClassNLLCriterion.cu:56:
void ClassNLLCriterion_updateOutput_no_reduce_kernel(int,
THCDeviceTensor<Dtype, 2, int, DefaultPtrTraits>, THCDeviceTensor<long, 1,
int, DefaultPtrTraits>, THCDeviceTensor<Dtype, 1, int, DefaultPtrTraits>,
Dtype
*, int, int) [with Dtype = float]: block: [0,0,0], thread: [0,0,0]
Assertion cur_target >= 0 && cur_target < n_classes failed. THCudaCheck
FAIL
file=/opt/conda/conda-bld/pytorch_1524577177097/work/aten/src/THC/generated/../THCReduceAll.cuh
line=339 error=59 : device-side assert triggered Traceback (most recent
call last): File "alignment_and_zeroshot.py", line 41, in main() File
"./main.py", line 77, in main scores.update(trainer.train(train_loader,
model, criterion, optimizer, epoch, args)) File "./train.py", line 99, in
train output, loss, weights = forward(inputs, target, model, criterion,
meta['id']) File "./train.py", line 76, in forward loss, weights =
criterion(*(list(output) + [target_var, ids]))
File
"/home/csdept/anaconda3/envs/py27/lib/python2.7/site-packages/torch/nn/modules/module.py",
line 491, in *call*
result = self.forward(*input, **kwargs)
File "./models/layers/ActorObserverLossAllWithClassifier.py", line 58, in
forward
f = self.clsweight * clsloss.sum()
RuntimeError: cuda runtime error (59) : device-side assert triggered at
/opt/conda/conda-bld/pytorch_1524577177097/work/aten/src/THC/generated/../THCReduceAll.cuh:339
/home/csdept/projects/actor-observer/models/layers/ActorObserverLossAllWithClassifier.py(58)forward()
-> f = self.clsweight * clsloss.sum()
(Pdb)
(Pdb)
And I double-check the paths, I think they are all correct. Do you have
any suggestions?
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#1 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/ADbmNb3r2rIdgsZBEa16O95gar5QIJY8ks5uCYz-gaJpZM4UyvSs>
.
|
Hey, I have downloaded the dataset, which part of original charades should I use, Data (scaled to 480p, 13GB), Data (original size) (55GB), RGB frames at 24fps (76GB) or Optical Flow at 24fps (45GB). Here is my third_to_first_person.py file, #!/usr/bin/env python args = [ Here is my opts.py, import argparse def parse(): return args Thank you in advance! |
RGB frames at 24fps (76GB) is what the code is expecting. Good catch! Looks like I forgot to update the hardcoded path in
You can edit this line directly in your code to your path. I pushed a commit adding an argument for this. Let me know if that helps. Best, |
The command I used is
python baseline_resnet152charades.py
.Thank you in advance!
=> using pre-trained model 'resnet152'
loading pretrained-weights from /nfs.yoda/gsigurds/charades_pretrained/resnet_rgb.pth.tar
Traceback (most recent call last):
File "baseline_resnet152charades.py", line 38, in
main()
File "./main.py", line 60, in main
model, criterion, optimizer = create_model(args)
File "./models/init.py", line 10, in create_model
model = load_architecture(args)
File "./models/utils.py", line 78, in load_architecture
model = generic_load(args.arch, args.pretrained, args.pretrained_weights, args)
File "./models/utils.py", line 61, in generic_load
model = model.dictarch
File "./models/ActorObserverBase.py", line 55, in init
model = load_sub_architecture(args)
File "./models/utils.py", line 73, in load_sub_architecture
model = generic_load(args.subarch, args.pretrained, args.pretrained_subweights, args)
File "./models/utils.py", line 65, in generic_load
chkpoint = torch.load(weights)
File "/home/csdept/anaconda3/envs/py27/lib/python2.7/site-packages/torch/serialization.py", line 301, in load
f = open(f, 'rb')
IOError: [Errno 2] No such file or directory: '/nfs.yoda/gsigurds/charades_pretrained/resnet_rgb.pth.tar'
The text was updated successfully, but these errors were encountered: