Skip to content

Commit 9b3f66b

Browse files
author
tibuch
authored
Merge pull request #8 from juglab/dev
Dev
2 parents b8115d1 + 7ae928d commit 9b3f66b

4 files changed

Lines changed: 144 additions & 7 deletions

File tree

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ Build Python package:
66
`python setup.py bdist_wheel`
77

88
Build singularity recipe:
9-
`neurodocker generate singularity -b nvidia/cuda:10.2-cudnn7-devel-ubuntu18.04 -p apt --copy /home/tibuch/Gitrepos/FourierImageTransformer/dist/fourier_image_transformers-0.1.5-py3-none-any.whl /fourier_image_transformers-0.1.5-py3-none-any.whl --miniconda create_env=fit conda_install='python=3.7 astra-toolbox pytorch torchvision torchaudio cudatoolkit=10.2 -c pytorch -c astra-toolbox/label/dev' pip_install='/fourier_image_transformers-0.1.5-py3-none-any.whl' activate=true --entrypoint "/neurodocker/startup.sh python" > v0.1.5.Singularity`
9+
`neurodocker generate singularity -b nvidia/cuda:10.2-cudnn7-devel-ubuntu18.04 -p apt --copy /home/tibuch/Gitrepos/FourierImageTransformer/dist/fourier_image_transformers-0.1.6-py3-none-any.whl /fourier_image_transformers-0.1.6-py3-none-any.whl --miniconda create_env=fit conda_install='python=3.7 astra-toolbox pytorch torchvision torchaudio cudatoolkit=10.2 -c pytorch -c astra-toolbox/label/dev' pip_install='/fourier_image_transformers-0.1.6-py3-none-any.whl' activate=true --entrypoint "/neurodocker/startup.sh python" > v0.1.6.Singularity`
1010

1111
Build singularity container:
12-
`sudo singularity build fit_v0.1.5.simg v0.1.5.Singularity`
12+
`sudo singularity build fit_v0.1.6.simg v0.1.6.Singularity`

fit/modules/TRecTransformerModule.py

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -116,10 +116,9 @@ def _fc_loss(self, pred_fc, target_fc, mag_min, mag_max):
116116

117117
def criterion(self, pred_fc, target_fc, target_real, mag_min, mag_max):
118118
fc_loss, amp_loss, phi_loss = self._fc_loss(pred_fc=pred_fc, target_fc=target_fc, mag_min=mag_min, mag_max=mag_max)
119-
# real_loss = self._real_loss(pred_fc=pred_fc, target_fc=target_fc, target_real=target_real, mag_min=mag_min,
120-
# mag_max=mag_max)
121-
# return fc_loss + real_loss
122-
return fc_loss, amp_loss, phi_loss
119+
real_loss = self._real_loss(pred_fc=pred_fc, target_fc=target_fc, target_real=target_real, mag_min=mag_min,
120+
mag_max=mag_max)
121+
return fc_loss + real_loss, amp_loss, phi_loss
123122

124123
def _bin_data(self, x_fc, y_fc):
125124
shells = (self.hparams.detector_len // 2 + 1) / self.bin_factor

fit/version.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
__version__ = '0.1.5'
1+
__version__ = '0.1.6'

singularity/v0.1.6.Singularity

Lines changed: 138 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,138 @@
1+
# Generated by: Neurodocker version 0.7.0
2+
# Latest release: Neurodocker version 0.7.0
3+
# Timestamp: 2021/01/11 22:18:13 UTC
4+
#
5+
# Thank you for using Neurodocker. If you discover any issues
6+
# or ways to improve this software, please submit an issue or
7+
# pull request on our GitHub repository:
8+
#
9+
# https://github.com/ReproNim/neurodocker
10+
11+
Bootstrap: docker
12+
From: nvidia/cuda:10.2-cudnn7-devel-ubuntu18.04
13+
14+
%post
15+
su - root
16+
17+
export ND_ENTRYPOINT="/neurodocker/startup.sh"
18+
apt-get update -qq
19+
apt-get install -y -q --no-install-recommends \
20+
apt-utils \
21+
bzip2 \
22+
ca-certificates \
23+
curl \
24+
locales \
25+
unzip
26+
apt-get clean
27+
rm -rf /var/lib/apt/lists/*
28+
sed -i -e 's/# en_US.UTF-8 UTF-8/en_US.UTF-8 UTF-8/' /etc/locale.gen
29+
dpkg-reconfigure --frontend=noninteractive locales
30+
update-locale LANG="en_US.UTF-8"
31+
chmod 777 /opt && chmod a+s /opt
32+
mkdir -p /neurodocker
33+
if [ ! -f "$ND_ENTRYPOINT" ]; then
34+
echo '#!/usr/bin/env bash' >> "$ND_ENTRYPOINT"
35+
echo 'set -e' >> "$ND_ENTRYPOINT"
36+
echo 'export USER="${USER:=`whoami`}"' >> "$ND_ENTRYPOINT"
37+
echo 'if [ -n "$1" ]; then "$@"; else /usr/bin/env bash; fi' >> "$ND_ENTRYPOINT";
38+
fi
39+
chmod -R 777 /neurodocker && chmod a+s /neurodocker
40+
41+
export PATH="/opt/miniconda-latest/bin:$PATH"
42+
echo "Downloading Miniconda installer ..."
43+
conda_installer="/tmp/miniconda.sh"
44+
curl -fsSL --retry 5 -o "$conda_installer" https://repo.continuum.io/miniconda/Miniconda3-latest-Linux-x86_64.sh
45+
bash "$conda_installer" -b -p /opt/miniconda-latest
46+
rm -f "$conda_installer"
47+
conda update -yq -nbase conda
48+
conda config --system --prepend channels conda-forge
49+
conda config --system --set auto_update_conda false
50+
conda config --system --set show_channel_urls true
51+
sync && conda clean -y --all && sync
52+
conda create -y -q --name fit
53+
conda install -y -q --name fit \
54+
"python=3.7" \
55+
"astra-toolbox" \
56+
"pytorch" \
57+
"torchvision" \
58+
"torchaudio" \
59+
"cudatoolkit=10.2" \
60+
"-c" \
61+
"pytorch" \
62+
"-c" \
63+
"astra-toolbox/label/dev"
64+
sync && conda clean -y --all && sync
65+
bash -c "source activate fit
66+
pip install --no-cache-dir \
67+
"/fourier_image_transformers-0.1.6-py3-none-any.whl""
68+
rm -rf ~/.cache/pip/*
69+
sync
70+
sed -i '$isource activate fit' $ND_ENTRYPOINT
71+
72+
73+
echo '{
74+
\n "pkg_manager": "apt",
75+
\n "instructions": [
76+
\n [
77+
\n "base",
78+
\n "nvidia/cuda:10.2-cudnn7-devel-ubuntu18.04"
79+
\n ],
80+
\n [
81+
\n "user",
82+
\n "root"
83+
\n ],
84+
\n [
85+
\n "_header",
86+
\n {
87+
\n "version": "generic",
88+
\n "method": "custom"
89+
\n }
90+
\n ],
91+
\n [
92+
\n "copy",
93+
\n [
94+
\n "/home/tibuch/Gitrepos/FourierImageTransformer/dist/fourier_image_transformers-0.1.6-py3-none-any.whl",
95+
\n "/fourier_image_transformers-0.1.6-py3-none-any.whl"
96+
\n ]
97+
\n ],
98+
\n [
99+
\n "miniconda",
100+
\n {
101+
\n "create_env": "fit",
102+
\n "conda_install": [
103+
\n "python=3.7",
104+
\n "astra-toolbox",
105+
\n "pytorch",
106+
\n "torchvision",
107+
\n "torchaudio",
108+
\n "cudatoolkit=10.2",
109+
\n "-c",
110+
\n "pytorch",
111+
\n "-c",
112+
\n "astra-toolbox/label/dev"
113+
\n ],
114+
\n "pip_install": [
115+
\n "/fourier_image_transformers-0.1.6-py3-none-any.whl"
116+
\n ],
117+
\n "activate": true
118+
\n }
119+
\n ],
120+
\n [
121+
\n "entrypoint",
122+
\n "/neurodocker/startup.sh python"
123+
\n ]
124+
\n ]
125+
\n}' > /neurodocker/neurodocker_specs.json
126+
127+
%environment
128+
export LANG="en_US.UTF-8"
129+
export LC_ALL="en_US.UTF-8"
130+
export ND_ENTRYPOINT="/neurodocker/startup.sh"
131+
export CONDA_DIR="/opt/miniconda-latest"
132+
export PATH="/opt/miniconda-latest/bin:$PATH"
133+
134+
%files
135+
/home/tibuch/Gitrepos/FourierImageTransformer/dist/fourier_image_transformers-0.1.6-py3-none-any.whl /fourier_image_transformers-0.1.6-py3-none-any.whl
136+
137+
%runscript
138+
/neurodocker/startup.sh python

0 commit comments

Comments
 (0)