Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
D
danceformer
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
grzonkow
danceformer
Commits
2b51d1ac
Commit
2b51d1ac
authored
1 year ago
by
Cassandra Grzonkowski
Browse files
Options
Downloads
Patches
Plain Diff
save dataset, remove audio if there is no chart
parent
dfa263fc
Loading
Loading
1 merge request
!1
Instant spectograms
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
main.py
+29
-17
29 additions, 17 deletions
main.py
model_run.sbatch
+2
-2
2 additions, 2 deletions
model_run.sbatch
preprocess.py
+4
-0
4 additions, 0 deletions
preprocess.py
with
35 additions
and
19 deletions
main.py
+
29
−
17
View file @
2b51d1ac
...
...
@@ -280,6 +280,8 @@ def custom_collate_fn(batch, max_len_specs, vocabulary):
def
setup_parser
():
out
=
argparse
.
ArgumentParser
()
out
.
add_argument
(
'
--vocabulary
'
,
default
=
None
,
type
=
str
,
help
=
"
Path to vocabulary
"
)
#out.add_argument('--dataset', default="C:/Users/cassi/OneDrive/Desktop/Master_Thesis/train_dataset.pkl", type=str, help="Path to dataset")
out
.
add_argument
(
'
--dataset
'
,
default
=
None
,
type
=
str
,
help
=
"
Path to dataset
"
)
return
out
...
...
@@ -323,23 +325,14 @@ if __name__ == '__main__':
print
(
"
Number parameters:
"
)
print
(
sum
(
p
.
numel
()
for
p
in
danceformer
.
parameters
()
if
p
.
requires_grad
))
if
args
.
dataset
is
None
:
start_time_first_step
=
time
.
time
()
all_paths
,
difficulties
,
charts
,
max_len_charts
=
get_paths_diff_charts
(
songs
,
indexed_vocabulary
)
elapsed_first_step
=
time
.
time
()
-
start_time_first_step
print
(
'
-
'
*
89
)
print
(
f
'
Get paths diff and charts done, time:
{
elapsed_first_step
:
5.2
f
}
s
'
)
print
(
'
-
'
*
89
)
# print(f"\nDifficulties: {difficulties}")
# difficulties = np.array(difficulties)
#print(f"\nNumber songs: {len(charts)}")
#print(f"\nNumber difficulties: {len(difficulties)}")
#print(f"\nDifficulties: {difficulties}")
#print(f"First entry length of charts: {len(charts[0])}")
#print(f"First chart first 20 entries: {charts[0][:21]}")
# Data loading.
train_dataset
=
SongPacksDataset
(
...
...
@@ -352,6 +345,25 @@ if __name__ == '__main__':
# shuffle = True,
)
#with open(r'C:/Users/cassi/OneDrive/Desktop/Master_Thesis/train_dataset.pkl', 'wb') as output:
with
open
(
r
'
/scratch/grzonkow/train_dataset.pkl
'
,
'
wb
'
)
as
output
:
pickle
.
dump
(
train_dataset
,
output
)
else
:
with
open
(
args
.
dataset
,
'
rb
'
)
as
data
:
train_dataset
=
pickle
.
load
(
data
)
# print(f"\nDifficulties: {difficulties}")
# difficulties = np.array(difficulties)
#print(f"\nNumber songs: {len(charts)}")
#print(f"\nNumber difficulties: {len(difficulties)}")
#print(f"\nDifficulties: {difficulties}")
#print(f"First entry length of charts: {len(charts[0])}")
#print(f"First chart first 20 entries: {charts[0][:21]}")
# max length = self defined maximal length of token sequence in seconds
# for each element/song: path of .og file, difficulties, charts
# check batch, output, maybe change to class / transform !
...
...
This diff is collapsed.
Click to expand it.
model_run.sbatch
+
2
−
2
View file @
2b51d1ac
...
...
@@ -7,8 +7,8 @@
#SBATCH --cpus-per-task=1 # use 1 thread per taks
#SBATCH -N 1 # request slots on 1 node
#SBATCH --partition=informatik-mind # run on one of our DGX servers
#SBATCH --output=/scratch/grzonkow/model_
prints_new
.txt # capture output
#SBATCH --error=/scratch/grzonkow/err_model_
prints_new
.txt # and error streams
#SBATCH --output=/scratch/grzonkow/model_
latest
.txt # capture output
#SBATCH --error=/scratch/grzonkow/err_model_
latest
.txt # and error streams
module load anaconda3/latest
.
$ANACONDA_HOME
/etc/profile.d/conda.sh
...
...
This diff is collapsed.
Click to expand it.
preprocess.py
+
4
−
0
View file @
2b51d1ac
...
...
@@ -164,6 +164,10 @@ def get_paths_diff_charts(song_dirs, indexed_vocabulary):
for
number
in
range
(
number_of_charts_diffs
-
1
):
all_paths
.
append
(
all_paths
[
-
1
])
# if no chart found but audio, remove audio, can be at most one more audio/path according check before
# -> remove last filepath
if
number_of_charts_diffs
==
0
and
len
(
all_paths
)
>
all_paths_old_len
:
all_paths
=
all_paths
[:
-
1
]
# verify number items is equal
#print(
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment