Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

arrays doesn't match. #1

Closed
aditya624 opened this issue Oct 12, 2021 · 2 comments
Closed

arrays doesn't match. #1

aditya624 opened this issue Oct 12, 2021 · 2 comments

Comments

@aditya624
Copy link

I tried multi classification, but the following error occurs when training. any solution?.

---------------------------------------------------------------------------
ValueError                                Traceback (most recent call last)
<ipython-input-97-34924934fd19> in <module>
      1 logging.getLogger('small_text').setLevel(logging.INFO)
----> 2 main()

<ipython-input-96-e3cc4fd7354b> in main()
     30         for i in range(20):
     31             # ...where each iteration consists of labelling 20 samples
---> 32             q_indices = active_learner.query(num_samples=20, x=train)
     33 
     34             # Simulate user interaction here. Replace this for real-world usage.

/opt/anaconda3/envs/small_text/lib/python3.7/site-packages/small_text-1.0.0a4-py3.7.egg/small_text/active_learner.py in query(self, num_samples, x, query_strategy_kwargs)
    175 
    176         self.mask = np.ones(size, bool)
--> 177         self.mask[np.concatenate([self.x_indices_labeled, self.x_indices_ignored])] = False
    178         indices = np.arange(size)
    179 

<__array_function__ internals> in concatenate(*args, **kwargs)

ValueError: all the input arrays must have same number of dimensions, but the array at index 0 has 1 dimension(s) and the array at index 1 has 0 dimension(s)
@chschroeder
Copy link
Contributor

chschroeder commented Oct 12, 2021

Hi Aditya,

thank you very much for reporting this problem!

Some parts of the examples seem to have not been adapted to recent changes. I fixed this just now and released 1.0.0a6.
If you reinstall now (pip install small-text[pytorch]==1.0.0.a6) this problem should be solved.

In case you are using a newer pytorch version, also have a look at issue #2 (and downgrade pytorch if necessary).

@chschroeder chschroeder reopened this Oct 12, 2021
@aditya624
Copy link
Author

Thank you. this works. :)

Hi Aditya,

thank you very much for reporting this problem!

Some parts of the examples seem to have not been adapted to recent changes. I fixed this just now and released 1.0.0a6. If you reinstall now (pip install small-text[pytorch]==1.0.0.a6) this problem should be solved.

In case you are using a newer pytorch version, also have a look at issue #2 (and downgrade pytorch if necessary).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants