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

[question] auto label error #36

Closed
luanon404 opened this issue Sep 21, 2022 · 1 comment
Closed

[question] auto label error #36

luanon404 opened this issue Sep 21, 2022 · 1 comment
Labels
documentation Improvements or additions to documentation

Comments

@luanon404
Copy link

luanon404 commented Sep 21, 2022

Question
im using auto label but i always got value error

i saved image by open(filename, "wb").write(bytes) i think here is error?

Expected behavior


PS D:\python\hcaptcha-model-factory\src> py main.py new 
prompt[en] --> fish_underwater
2022-09-21 19:57:05 | DEBUG - Diagnose task | task_name=fish_underwater
Use AI to automatically label datasets? {'y', 'n'} --> y
please put all the images in the `unlabel` folder and press any key to continue...
2022-09-21 19:57:26 | INFO - Found 7 images in D:\python\hcaptcha-model-factory\data\fish_underwater\unlabel
2022-09-21 19:57:26 | DEBUG - Extracting embeddings...
2022-09-21 19:57:27 | INFO - Embeddings extracted
2022-09-21 19:57:27 | INFO - PCA..., shape of embs: (7, 512)
2022-09-21 19:57:27 | ERROR - An error has been caught in function '_CallAndUpdateTrace', process 'MainProcess' (8452), thread 'MainThread' (21844):
Traceback (most recent call last):
  File "main.py", line 6, in <module>
    Fire(Scaffold)
  File "C:\Users\luanon404\AppData\Local\Programs\Python\Python38\lib\site-packages\fire\core.py", line 141, in Fire
    component_trace = _Fire(component, args, parsed_flag_args, context, name)
  File "C:\Users\luanon404\AppData\Local\Programs\Python\Python38\lib\site-packages\fire\core.py", line 466, in _Fire
    component, remaining_args = _CallAndUpdateTrace(
> File "C:\Users\luanon404\AppData\Local\Programs\Python\Python38\lib\site-packages\fire\core.py", line 681, in _CallAndUpdateTrace
    component = fn(*varargs, **kwargs)
  File "D:\python\hcaptcha-model-factory\src\apis\scaffold.py", line 70, in new
    ClusterLabeler(data_dir=data_dir).run()
  File "D:\python\hcaptcha-model-factory\src\components\auto_label\cluster.py", line 65, in run
    self.embs = PCA(n_components=self.num_feat).fit_transform(self.embs)
  File "C:\Users\luanon404\AppData\Local\Programs\Python\Python38\lib\site-packages\sklearn\decomposition\_pca.py", line 407, in fit_transform
    U, S, Vt = self._fit(X)
  File "C:\Users\luanon404\AppData\Local\Programs\Python\Python38\lib\site-packages\sklearn\decomposition\_pca.py", line 457, in _fit
    return self._fit_full(X, n_components)
  File "C:\Users\luanon404\AppData\Local\Programs\Python\Python38\lib\site-packages\sklearn\decomposition\_pca.py", line 475, in _fit_full
    raise ValueError(
ValueError: n_components=128 must be between 0 and min(n_samples, n_features)=7 with svd_solver='full'

Desktop (please complete the following information):

  • OS: windows
  • Version: latest

Additional context
cf461699-6add-408a-aa9a-fd568c088c82
ec656c58-afcb-4644-a09c-4a00f8c4f6c2
f13f04dd-7284-4cd8-9d25-609dbc2bd418
fc658142-4c28-4778-ab1e-4979bf283bcd
0d903179-757d-4ef2-98d1-2b0bc25ef85d
4c1633ef-a109-41ab-8f94-b6fd45efff6f
a37fb4c2-930f-45cd-81c7-e7798cc15693

@luanon404 luanon404 added the documentation Improvements or additions to documentation label Sep 21, 2022
beiyuouo added a commit that referenced this issue Sep 21, 2022
@beiyuouo
Copy link
Collaborator

beiyuouo commented Sep 21, 2022

I have fix it at 3190b6c. You can pull the dev branch or manually modify to fix it. We will release it soon! Thanks a lot.

@beiyuouo beiyuouo mentioned this issue Oct 9, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation
Projects
None yet
Development

No branches or pull requests

2 participants