modAL-python / modAL

A modular active learning framework for Python
https://modAL-python.github.io/
MIT License
2.23k stars 324 forks source link

I made this error while running the official Python example. What's the matter #109

Closed ghost closed 4 years ago

ghost commented 4 years ago

epoch train_loss dur


  1        3.2377  2.2691
  2        2.3052  0.2623
  3        2.1487  0.2628
  4        1.4069  0.2563
  5        1.0567  0.2543
  6        0.8704  0.2523
  7        0.8014  0.2496
  8        0.7548  0.2493
  9        0.6871  0.2533
 10        0.6194  0.2553

Query no. 1 Traceback (most recent call last): File "E:/PycharmProjects/pytorch/3另另另mixMatch-master/mixMatch-master/1.py", line 82, in query_idx, query_instance = learner.query(X_pool, n_instances=100) File "C:\software\anaconda3\envs\pytorch\lib\site-packages\modAL\models\base.py", line 269, in query return query_result, retrieve_rows(X_pool, query_result) File "C:\software\anaconda3\envs\pytorch\lib\site-packages\modAL\utils\data.py", line 101, in retrieve_rows raise TypeError('%s datatype is not supported' % type(X)) TypeError: <class 'torch.Tensor'> datatype is not supported

nawabhussain commented 4 years ago

@Wan-Dou The data type that is being passed is of Type Tensor, which as of now is not a supported Data type. The supported Data types are:

michelewang commented 4 years ago

I experienced a similar issue when running the MNIST example -- how should it be resolved in the context of the example? It seems that early on the data is read in using the ToTensor() function? EDIT-- I just ended up casting the X and y datasets to np.array and that solved the issue

Also, this library looks really promising and I'm excited to use it! Thank you for all your work on this!

cosmic-cortex commented 4 years ago

Hi!

Sorry for the relatively late answer, @nawabhussain is totally right. Currently, modAL does not support the torch.Tensor datatype. However, this would be a useful feature, so I am opening an issue on this and close this one. Let me know if there is anything else!