I've been faced with an error in the PositionalEmbedding step on the original notebook
Maintainer thường phản hồi trong vòng 11 ngày
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 3/5
- Thời gian dự kiến
- 1-2 ngày
- Mức phù hợp với người mới
- 25/100
- Loại issue
- Lỗi
- Độ rõ ràng
- Cần làm rõ
- Mức độ hoạt động
- Đình trệ
- Công nghệ
- python
- Lĩnh vực
- machine-learning
Hướng nghiên cứu
Bắt đầu với lớp PositionalEmbedding và ô notebook gọi embed_pt(pt), sau đó tái hiện lỗi được báo cáo bằng cách sử dụng shape và dtype của tensor như đã nêu. Hoàn tất khi bước PositionalEmbedding của notebook gốc chạy mà không gặp lỗi Invalid dtype.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
class PositionalEmbedding(tf.keras.layers.Layer):
def __init__(self, vocab_size, d_model):
super().__init__()
self.d_model = d_model
self.embedding = tf.keras.layers.Embedding(vocab_size, d_model, mask_zero=True)
self.pos_encoding = positional_encoding(length=2048, depth=d_model)
def compute_mask(self, *args, **kwargs):
return self.embedding.compute_mask(*args, **kwargs)
def call(self, x):
length = tf.shape(x)[1]
x = self.embedding(x)
# This factor sets the relative scale of the embedding and positonal_encoding.
x *= tf.math.sqrt(tf.cast(self.d_model, tf.float32))
x = x + self.pos_encoding[tf.newaxis, :length, :]
return x
embed_pt = PositionalEmbedding(vocab_size=tokenizers.pt.get_vocab_size(), d_model=512)
pt_emb = embed_pt(pt)
Error Log:
---------------------------------------------------------------------------
ValueError Traceback (most recent call last)
[<ipython-input-79-19249302cd7f>](https://localhost:8080/#) in <cell line: 1>()
----> 1 pt_emb = embed_pt(pt)
2 en_emb = embed_en(en)
1 frames
[/usr/local/lib/python3.10/dist-packages/keras/src/utils/traceback_utils.py](https://localhost:8080/#) in error_handler(*args, **kwargs)
120 # To get the full stack trace, call:
121 # `keras.config.disable_traceback_filtering()`
--> 122 raise e.with_traceback(filtered_tb) from None
123 finally:
124 del filtered_tb
[<ipython-input-77-e9ab4e283481>](https://localhost:8080/#) in call(self, x)
11 def call(self, x):
12 length = tf.shape(x)[1]
---> 13 x = self.embedding(x)
14 # This factor sets the relative scale of the embedding and positonal_encoding.
15 x *= tf.math.sqrt(tf.cast(self.d_model, tf.float32))
ValueError: Exception encountered when calling PositionalEmbedding.call().
Invalid dtype: <property object at 0x7e5961d38810>
Arguments received by PositionalEmbedding.call():
• x=tf.Tensor(shape=(64, 92), dtype=int64)
- Ngôn ngữ chính
- C++
- Star
- 1.3k
- Fork
- 376
- Merge trung bình
- 7 ngày 17 giờ
- Pull request đã merge (30 ngày)
- 7
Chuẩn bị môi trường
- Không có Dockerfile hay tệp Docker Compose
- Không có mẫu pull request
- Đọc hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của tensorflow/text
-
Is there a plan to release 2.21?Đang mở
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 25/100
tensorflow/text#1498 · 2 bình luận ·
Maintainer thường phản hồi trong vòng 11 ngày
-
Dataset for tutorial missingĐang mở
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 35/100
tensorflow/text#1497 ·
Maintainer thường phản hồi trong vòng 11 ngày
-
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 20/100
tensorflow/text#1448 · 3 reaction ·
Maintainer thường phản hồi trong vòng 11 ngày
-
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 35/100
tensorflow/text#1421 · 2 bình luận · 1 reaction ·
Maintainer thường phản hồi trong vòng 11 ngày
-
Allow `tensorflow-text[cpu]`Đang mở
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 38/100
tensorflow/text#1393 · 1 reaction ·
Maintainer thường phản hồi trong vòng 11 ngày
Tất cả issue của tensorflow/text
Issue tương tự
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 83/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
-
[BUG] Clipboard History: Buffer over-read in WideCharToMultiByte on double-click pasteCó thể đã có người làm @softmgr đã nhận hôm nay. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100
notepad-plus-plus/notepad-plus-plus#18519 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 88/100
justcallmekoko/ESP32Marauder#1635 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
3.7.6-dev commit 80481ea - files not centered when resolution differs and zoom = "pixel-to-pixel"Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
grizzlypeak3d/DJV#931 ·