Comments (6)
replace the following code:
with the following code to do alignment:
if key_layer.shape[0] > query_layer.shape[0]:
key_layer = key_layer[:query_layer.shape[0], :, :, :]
attention_mask = attention_mask[:query_layer.shape[0], :, :]
value_layer = value_layer[:query_layer.shape[0], :, :, :]
attention_scores = torch.matmul(query_layer, key_layer.transpose(-1, -2))
from recognize-anything.
Thank you for your very valuable feedback. I will check this issue and give you a response as soon as possible in next few days.
from recognize-anything.
I had the same problem, I lowered the version of transformers to no avail
from recognize-anything.
The reason behind the issue is that our code has been modified based on BLIP. To resolve the issue quickly, you can refer to a simple solution provided in this GitHub comment: salesforce/BLIP#142 (comment).
Further modifications are required in the Tag2Text/models/bert.py file to align it with the new version of the transformer. I have added this to my pending tasks list, but due to my current workload, I cannot ensure completion as soon as possible. Really hope you can understand.
Sincerely Thank you once again for bringing this issue to my attention.
from recognize-anything.
Thank you very much for sharing! If you have already tested the corresponding version, you are very welcome to be one of the contributors to this project by initiating Pull Requests (please add comments in the corresponding area). We appreciate your willingness for sharing and look forward to your contributions.
from recognize-anything.
replace the following code:
with the following code to do alignment:
if key_layer.shape[0] > query_layer.shape[0]: key_layer = key_layer[:query_layer.shape[0], :, :, :] attention_mask = attention_mask[:query_layer.shape[0], :, :] value_layer = value_layer[:query_layer.shape[0], :, :, :] attention_scores = torch.matmul(query_layer, key_layer.transpose(-1, -2))
It works, thx!
from recognize-anything.
Related Issues (20)
- Utilize SoViT-400m/14 image encoder HOT 1
- The pre-trained checkpoint HOT 1
- pre_caption function
- 4M version checkpoint HOT 1
- Can i inference RAM to output text? HOT 2
- RuntimeError: checkpoint url or path is invalid HOT 1
- 一个tag对应tag_chinese多个标签,如"table"==“桌子/表格”,如何过滤标签 HOT 6
- Error while running inference_ram_plus.py HOT 2
- generative tagging HOT 1
- Is `loss_t2t` in RAM necessary? Can I just remove it? HOT 7
- Finetuning question HOT 7
- Some questions about fine-tuning recognize-anything model HOT 1
- Relax transformers dependency version HOT 3
- Why is the tag and Caption text predicted by Tag2Text different? Why didn't Tag2Text use specific tags given by user?
- about training 4M dataset and the loss converge slowly HOT 3
- A question on embedding
- NameError: name '_C' is not defined HOT 1
- VisionTransformer undefined in ram.models.utils.py
- HuggingFace App is not working HOT 1
- Uncertain output results
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 recognize-anything.