Comments (4)
Sorry, the my original repo did not contain this line of code, please check if you added it yourself
my original repo in Line 86-92:
def forward(self, labels, masks):
b, temporal_len = masks.shape
prompts, pad_masks = self.prompt_learner(labels, b, temporal_len, masks.device)
# [N T U D]
prompts = prompts.to(masks.device)
# [N T U 1] -> [N*T U 1]
pad_masks = pad_masks.reshape([-1] + list(pad_masks.shape[2:])).to(masks. Device)
from svtas.
repo https://github.com/Thinksky5124/SVTAS/blob/svtas-paper/model/backbones/language/learner_prompt.py
Line 253-257:
def forward(self, last_clip_labels, batch_size, temporal_len, device):
#! this judge
if last_clip_labels is None:
start_promot = self._tokenizer.tokenize("").to(device)
start_promot_embedding = self.token_embedding(start_promot)
prompts = start_promot_embedding[:, :1].expand(batch_size, temporal_len // self.sample_rate, self.max_len, -1)
else:
text_list = []
for b in range(batch_size):
if torch.any(last_clip_labels[b,:] == self.ignore_index):
end_promot = self._tokenizer.tokenize("").to(device)
end_promot_embedding = self.token_embedding(end_promot)
embedding = end_promot_embedding[:, 1:2].expand(1, temporal_len // self.sample_rate, self.max_len, -1)
text_list.append(embedding)
else:
embedding = self.convert_id_to_promot(last_clip_labels[b, ::self.sample_rate])
text_list.append(embedding.unsqueeze(0))
# [N T U D]
prompts = torch.cat(text_list, dim=0)
pad_masks = torch.where(prompts != 0., torch.ones_like(prompts), torch.zeros_like(prompts))[:, :, :, 0:1]
return prompts, pad_masks
deal with the problem of label
is None, so, I think this is your problem
from svtas.
yes,’print('labels',labels.size())‘ is added by myself in order to check the input of the LearnerPromptTextEncoder, and then I find it is None. Could you teach me how to initialize the input of the text encoder? @Thinksky5124
from svtas.
yeah ,I find my datasets' groundtruth was wrong. Thank you!
from svtas.
Related Issues (8)
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 svtas.