shenweichen / DeepCTR-Torch

【PyTorch】Easy-to-use,Modular and Extendible package of deep-learning based CTR models.
https://deepctr-torch.readthedocs.io/en/latest/index.html
Apache License 2.0
3.04k stars 707 forks source link

Example error run_classification_criteo.py #102

Closed xinyu009 closed 4 years ago

xinyu009 commented 4 years ago

Describe the bug(问题描述) A clear and concise description of what the bug is. cuda ready... cuda:0 Train on 160 samples, validate on 0 samples, 5 steps per epoch Traceback (most recent call last): File "run_classification_criteo.py", line 62, in batch_size=32, epochs=10, validation_split=0.0, verbose=2) File "/home/xinyu/anaconda3/lib/python3.7/site-packages/deepctr_torch/models/basemodel.py", line 224, in fit total_loss.backward(retain_graph=True) File "/home/xinyu/anaconda3/lib/python3.7/site-packages/torch/tensor.py", line 198, in backward torch.autograd.backward(self, gradient, retain_graph, create_graph) File "/home/xinyu/anaconda3/lib/python3.7/site-packages/torch/autograd/init.py", line 100, in backward allow_unreachable=True) # allow_unreachable flag RuntimeError: one of the variables needed for gradient computation has been modified by an inplace operation: [torch.cuda.FloatTensor [128]], which is output 0 of SelectBackward, is at version 2; expected version 1 instead. Hint: enable anomaly detection to find the operation that failed to compute its gradient, with torch.autograd.set_detect_anomaly(True).

To Reproduce(复现步骤) Steps to reproduce the behavior:

  1. Just run run_classification_criteo.py

Operating environment(运行环境):

Additional context Add any other context about the problem here.

huanhuancao commented 4 years ago

Hello! Have you solved the problem?

diff7 commented 4 years ago

same problem

shenweichen commented 4 years ago

we have solved this issue in new version , please use pip install -U deepctr-torch to upgrade.