=== Software ===
python version : 3.7.0
fastai version : 1.0.22
torch version : 1.0.0.dev20181112
torch cuda ver
torch cuda is : **Not available**
=== Hardware ===
No GPUs available
=== Environment ===
platform : Linux-4.15.0-34-generic-x86_64-with-debian-buster-sid
distro : #37-Ubuntu SMP Mon Aug 27 15:21:48 UTC 2018
conda env : fastai
python : ~/miniconda3/envs/fastai/bin/python
sys.path :
~/miniconda3/envs/fastai/lib/python37.zip
~/miniconda3/envs/fastai/lib/python3.7
~/miniconda3/envs/fastai/lib/python3.7/lib-dynload
~/miniconda3/envs/fastai/lib/python3.7/site-packages
~/miniconda3/envs/fastai/lib/python3.7/site-packages/IPython/extensions
no supported gpus found on this system
My program is a simple test of the tabular methods:
from fastai import *
from fastai.tabular import *
n=np.random.random((10,5))
df=pd.DataFrame(n,columns=[‘val’,‘o1’,‘o2’,‘o3’,‘o4’])
train_df = df.copy()[:7]
valid_df = df.copy()[-3:]
pth=Path(’.’)
data = TabularDataBunch.from_df(pth, train_df, valid_df, “val”)
The error is from running the following command:
learn = get_tabular_learner(data, layers=[5,5],metrics=accuracy,use_bn=False)
---------------------------------------------------------------------------
TypeError Traceback (most recent call last)
<ipython-input-33-b81eaa87b01c> in <module>
----> 1 learn = get_tabular_learner(data, layers=[5,5],metrics=accuracy,tfms=[FillMissing],use_bn=False)
~/miniconda3/envs/fastai/lib/python3.7/site-packages/fastai/tabular/data.py in get_tabular_learner(data, layers, emb_szs, metrics, ps, emb_drop, y_range, use_bn, **kwargs)
95 emb_szs = data.get_emb_szs(ifnone(emb_szs, {}))
96 model = TabularModel(emb_szs, len(data.cont_names), out_sz=data.c, layers=layers, ps=ps, emb_drop=emb_drop,
---> 97 y_range=y_range, use_bn=use_bn)
98 return Learner(data, model, metrics=metrics, **kwargs)
99
~/miniconda3/envs/fastai/lib/python3.7/site-packages/fastai/tabular/models.py in __init__(self, emb_szs, n_cont, out_sz, layers, ps, emb_drop, y_range, use_bn)
20 layers = []
21 for i,(n_in,n_out,dp,act) in enumerate(zip(sizes[:-1],sizes[1:],[0.]+ps,actns)):
---> 22 layers += bn_drop_lin(n_in, n_out, bn=use_bn and i!=0, p=dp, actn=act)
23 self.layers = nn.Sequential(*layers)
24
~/miniconda3/envs/fastai/lib/python3.7/site-packages/fastai/layers.py in bn_drop_lin(n_in, n_out, bn, p, actn)
31 layers = [nn.BatchNorm1d(n_in)] if bn else []
32 if p != 0: layers.append(nn.Dropout(p))
---> 33 layers.append(nn.Linear(n_in, n_out))
34 if actn is not None: layers.append(actn)
35 return layers
~/miniconda3/envs/fastai/lib/python3.7/site-packages/torch/nn/modules/linear.py in __init__(self, in_features, out_features, bias)
46 self.in_features = in_features
47 self.out_features = out_features
---> 48 self.weight = Parameter(torch.Tensor(out_features, in_features))
49 if bias:
50 self.bias = Parameter(torch.Tensor(out_features))
TypeError: new() received an invalid combination of arguments - got (NoneType, int), but expected one of:
* (torch.device device)
* (torch.Storage storage)
* (Tensor other)
* (tuple of ints size, torch.device device)
didn't match because some of the arguments have invalid types: (NoneType, int)
* (object data, torch.device device)
didn't match because some of the arguments have invalid types: (NoneType, int)
What is the reason for this error? The data is all float64. I also tried changing all the data to float32. Not sure where the (NoneType, int) is coming from. Btw, The tabular examples from fastai/examples works fine.
Any help is greatly appreciated.
Thank you!