tata1661 / FSL-Mate

FSL-Mate: A collection of resources for few-shot learning (FSL).

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

(InvalidArgument) Tensor holds the wrong type, it holds int, but desires to be int64_t.

NNNNeverland opened this issue · comments

Run the sample code and report an error. The error information and code information are as follows.

ValueError: (InvalidArgument) Tensor holds the wrong type, it holds int, but desires to be int64_t.
[Hint: Expected valid == true, but received valid:0 != true:1.] (at C:\home\workspace\Paddle_release\paddle/fluid/framework/tensor_impl.h:33)
[operator < softmax_with_cross_entropy > error]

from paddlefsl.datasets import MiniImageNet
import paddle
import paddlefsl
from paddlefsl.model_zoo import maml

TRAIN_DATASET = paddlefsl.datasets.MiniImageNet(mode='train')
VALID_DATASET = paddlefsl.datasets.MiniImageNet(mode='valid')
TEST_DATASET = paddlefsl.datasets.MiniImageNet(mode='test')
MODEL = paddlefsl.backbones.Conv(input_size=(3, 84, 84), output_size=5)

def main():
train_dir = maml.meta_training(train_dataset=TRAIN_DATASET,
valid_dataset=VALID_DATASET,
ways=5,
shots=1,
model=MODEL,
meta_lr=0.002,
inner_lr=0.03,
iterations=10000,
meta_batch_size=32,
inner_adapt_steps=5,
report_iter=10)

if name == 'main':
main()

I can run your code on my computer. Please check your environment configuration(the version of python, paddlepaddle). Thanks!

Since no further questions are posted, I close this issue.
If you satisfy the environment requirement and still do not make it work, please feel free to reopen it.