liyaguang / DCRNN

Implementation of Diffusion Convolutional Recurrent Neural Network in Tensorflow
MIT License
1.21k stars 400 forks source link

error Run the Pre-trained Model on my data #40

Closed hana9090 closed 5 years ago

hana9090 commented 5 years ago

after generate train/test for my data which simply contains two columns ( Date, price). I got this information about the training and testing data: image

But after running Run the Pre-trained Model, I got the following exception:

ValueError: Cannot feed value of shape (64, 12, 1, 2) for Tensor 'Test/DCRNN/inputs:0', which has shape '(64, 12, 207, 2)'

image

Is there anything to do to solve this? Thanks

razvanc92 commented 5 years ago

I don't think you generated the data right. The data should have shape (N=samples, horizon=12, nodes=207, features=2) it looks like you only generated the data for 1 sensor.

hana9090 commented 5 years ago

This is my df data: image

I used this script to generate .h5 data.

from pandas import (
    DataFrame, HDFStore
)
import pandas as pd
import numpy as np
# creating a HDF5 file
store = HDFStore('data/dataset3.h5')
# adding dataframe to the HDF5 file
store.put('d1', df, format='table') #, data_columns=True)
store.close()

From the link you provide.

harshgrovr commented 5 years ago

@hana9090

Hey I am facing the same issue, were you able to resolve?

liyaguang commented 5 years ago

Hi @hana9090 , as mentioned by @razvanc92 , the format of the data does not match. Besides, the pre-trained model is only expected to do inference on traffic data. Thus, even the format fit, the model will probably not generate a good results for the dataset you mentioned. You may have to prepare the problem-specific training data, and train the model from scratch.