As_tensor error in keras

,

I am using keras/tensorflow in R and have an issue with as_tensor.

My test data example looks like :

X1 X2
-1 9837
-1 10000
-1 10154
-1 10000
-1 9894
-1 10000

str( training_ds[,1:2])
‘data.frame’: 109819 obs. of 2 variables:
$ X1: int -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 …
$ X2: int 10031 10000 9880 10000 9996 10000 10252 10000 9998 10000 …

When I run, as_tensor, I receive the error :
Error: basic_string::substr: __pos (which is 2354882) > this->size() (which is 1177900)

I am able to run as_tensor on the individual columns, but not on the whole dataset. All of the data is the same type, int. Also, I made sure I do have any NA.

How do I debug this?

Thanks

For some reason, if I do this operation : as_tensor( t(t(training_ds)) ), then the operation succeeds. Not sure, why as_tensor(training_ds) doesn’t work.

Ideas?