Skip to content

UnboundLocalError: local variable 'DATA' referenced before assignment #2620

@dlhagger

Description

@dlhagger

Is there an existing issue for this?

  • I have searched the existing issues

Bug description

When using 3.0rc - when trying to extract frames, I am getting an error for K-means clustering

Operating System

operating system macos

DeepLabCut version

dlc version3.0rc

DeepLabCut mode

single animal

Device type

gpu

Steps To Reproduce

No response

Relevant log output

(deeplabcut3) haggertydl@DLH-Mac-Mini-Work ~ % python -m deeplabcut
Loading DLC 3.0.0rc1...
Starting GUI...
QPixmap::scaled: Pixmap is a null pixmap
Traceback (most recent call last):
  File "/Users/haggertydl/miniforge3/envs/deeplabcut3/lib/python3.10/site-packages/deeplabcut/gui/window.py", line 359, in <lambda>
    QTimer.singleShot(1000, lambda: _check_for_updates(silent=True))
  File "/Users/haggertydl/miniforge3/envs/deeplabcut3/lib/python3.10/site-packages/deeplabcut/gui/window.py", line 66, in _check_for_updates
    update_btn = msg.addButton("Update", msg.AcceptRole)
AttributeError: 'PySide6.QtWidgets.QMessageBox' object has no attribute 'AcceptRole'. Did you mean: 'acceptDrops'?
INFO:console:Created "/Users/haggertydl/Desktop/test-dlh-2024-06-17/videos"
INFO:console:Created "/Users/haggertydl/Desktop/test-dlh-2024-06-17/labeled-data"
INFO:console:Created "/Users/haggertydl/Desktop/test-dlh-2024-06-17/training-datasets"
INFO:console:Created "/Users/haggertydl/Desktop/test-dlh-2024-06-17/dlc-models"
INFO:console:Copying the videos
INFO:console:/Users/haggertydl/Desktop/test-dlh-2024-06-17/videos/m3v1mp4.mp4
INFO:console:Generated "/Users/haggertydl/Desktop/test-dlh-2024-06-17/config.yaml"
INFO:console:
A new project with name test-dlh-2024-06-17 is created at /Users/haggertydl/Desktop and a configurable file (config.yaml) is stored there. Change the parameters in this file to adapt to your project's needs.
 Once you have changed the configuration file, use the function 'extract_frames' to select frames for labeling.
. [OPTIONAL] Use the function 'add_new_videos' to add new videos to your project (at any stage).
INFO:console:Project "test" successfully loaded.
INFO:console:Config file read successfully.
INFO:console:Extracting frames based on kmeans ...
INFO:console:Kmeans-quantization based extracting of frames from
INFO:console: 
INFO:console:0.0
INFO:console: 
INFO:console: seconds to
INFO:console: 
INFO:console:77.67
INFO:console: 
INFO:console: seconds.
INFO:console:Extracting and downsampling...
INFO:console: 
INFO:console:2330
INFO:console: 
INFO:console: frames from the video.
2330it [00:00, 472706.22it/s]
Traceback (most recent call last):
  File "/Users/haggertydl/miniforge3/envs/deeplabcut3/lib/python3.10/site-packages/deeplabcut/gui/utils.py", line 22, in run
INFO:console:Kmeans clustering ... (this might take a while)
    self.func()
  File "/Users/haggertydl/miniforge3/envs/deeplabcut3/lib/python3.10/site-packages/deeplabcut/generate_training_dataset/frame_extraction.py", line 383, in extract_frames
    frames2pick = frameselectiontools.KmeansbasedFrameselectioncv2(
  File "/Users/haggertydl/miniforge3/envs/deeplabcut3/lib/python3.10/site-packages/deeplabcut/utils/frameselectiontools.py", line 365, in KmeansbasedFrameselectioncv2
    data = DATA - DATA.mean(axis=0)
UnboundLocalError: local variable 'DATA' referenced before assignment

Anything else?

No response

Code of Conduct

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions