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

InvalidArgumentError: Incompatible shapes: [100,24,24,1] vs. [100,10,10,1] #10

Open
akashcmd opened this issue Oct 25, 2022 · 2 comments

Comments

@akashcmd
Copy link

akashcmd commented Oct 25, 2022

Hi @tjvandal and other collaborators,
I tried to run bash run_job.sh but it showed this same error. I am stuck with this error since a week now and am not able to find a solution to it. Could you please help me urgently.

image

Note : The data is downloaded successfully and completely. I have the following files and the files in scratch folder.
image

Error

Exception has occurred: InvalidArgumentError
Incompatible shapes: [100,24,24,1] vs. [100,10,10,1]
	 [[Node: loss/sub = Sub[T=DT_FLOAT, _device="/job:localhost/replica:0/task:0/device:CPU:0"](hidden_2/conv2d/BiasAdd, loss/cond/Merge)]]

Caused by op u'loss/sub', defined at:
  File "/opt/anaconda3/envs/reaps27/lib/python2.7/runpy.py", line 174, in _run_module_as_main
    "__main__", fname, loader, pkg_name)
  File "/opt/anaconda3/envs/reaps27/lib/python2.7/runpy.py", line 72, in _run_code
    exec code in run_globals
  File "/Users/akashcmd/.vscode/extensions/ms-python.python-2021.12.1559732655/pythonFiles/lib/python/debugpy/__main__.py", line 45, in <module>
    cli.main()
  File "/Users/akashcmd/.vscode/extensions/ms-python.python-2021.12.1559732655/pythonFiles/lib/python/debugpy/../debugpy/server/cli.py", line 444, in main
    run()
  File "/Users/akashcmd/.vscode/extensions/ms-python.python-2021.12.1559732655/pythonFiles/lib/python/debugpy/../debugpy/server/cli.py", line 285, in run_file
    runpy.run_path(target_as_str, run_name=compat.force_str("__main__"))
  File "/opt/anaconda3/envs/reaps27/lib/python2.7/runpy.py", line 252, in run_path
    return _run_module_code(code, init_globals, run_name, path_name)
  File "/opt/anaconda3/envs/reaps27/lib/python2.7/runpy.py", line 82, in _run_module_code
    mod_name, mod_fname, mod_loader, pkg_name)
  File "/opt/anaconda3/envs/reaps27/lib/python2.7/runpy.py", line 72, in _run_code
    exec code in run_globals
  File "/Users/akashcmd/Projects/deepsd/train.py", line 157, in <module>
    train()
  File "/Users/akashcmd/Projects/deepsd/train.py", line 97, in train
    is_training=is_training)
  File "/Users/akashcmd/Projects/deepsd/srcnn-tensorflow/srcnn/srcnn.py", line 47, in __init__
    self._build_graph()
  File "/Users/akashcmd/Projects/deepsd/srcnn-tensorflow/srcnn/srcnn.py", line 114, in _build_graph
    self.loss = self._loss(_prediction_norm)
  File "/Users/akashcmd/Projects/deepsd/srcnn-tensorflow/srcnn/srcnn.py", line 83, in _loss
    err = tf.square(predictions - _y)
  File "/opt/anaconda3/envs/reaps27/lib/python2.7/site-packages/tensorflow/python/ops/math_ops.py", line 894, in binary_op_wrapper
    return func(x, y, name=name)
  File "/opt/anaconda3/envs/reaps27/lib/python2.7/site-packages/tensorflow/python/ops/gen_math_ops.py", line 4636, in _sub
    "Sub", x=x, y=y, name=name)
  File "/opt/anaconda3/envs/reaps27/lib/python2.7/site-packages/tensorflow/python/framework/op_def_library.py", line 787, in _apply_op_helper
    op_def=op_def)
  File "/opt/anaconda3/envs/reaps27/lib/python2.7/site-packages/tensorflow/python/framework/ops.py", line 2956, in create_op
    op_def=op_def)
  File "/opt/anaconda3/envs/reaps27/lib/python2.7/site-packages/tensorflow/python/framework/ops.py", line 1470, in __init__
    self._traceback = self._graph._extract_stack()  # pylint: disable=protected-access

InvalidArgumentError (see above for traceback): Incompatible shapes: [100,24,24,1] vs. [100,10,10,1]
	 [[Node: loss/sub = Sub[T=DT_FLOAT, _device="/job:localhost/replica:0/task:0/device:CPU:0"](hidden_2/conv2d/BiasAdd, loss/cond/Merge)]]
  File "/Users/akashcmd/Projects/deepsd/train.py", line 135, in train
    feed_dict=feed_dict(True))
  File "/Users/akashcmd/Projects/deepsd/train.py", line 157, in <module>
    train()

Steps to Reproduce

  1. Run prism.py with python 2.7 and download the required files
  2. Run bash run_job.sh

Reopening Issue : #8

@akashcmd
Copy link
Author

akashcmd commented Oct 25, 2022

I am using MacOs with Apple Silicon M1 chip.

image

I have setup the following conda environment :

name: reaps27
channels:
  - pytorch
  - menpo
  - anaconda
  - conda-forge
  - defaults
dependencies:
  - autopep8=1.6.0=pyhd3eb1b0_0
  - backports=1.1=pyhd3eb1b0_0
  - backports.functools_lru_cache=1.6.4=pyhd3eb1b0_0
  - backports_abc=0.5=py_1
  - blas=1.0=mkl
  - bleach=1.5.0=py27_0
  - bzip2=1.0.8=h1de35cc_0
  - ca-certificates=2022.4.26=hecd8cb5_0
  - cairo=1.14.12=hc4e6be7_4
  - certifi=2020.6.20=pyhd3eb1b0_3
  - curl=7.67.0=ha441bb4_0
  - cycler=0.10.0=py27hfc73c78_0
  - enum34=1.1.6=py27_1
  - expat=2.4.4=he9d5cce_0
  - fontconfig=2.13.1=ha9ee91d_0
  - freetype=2.11.0=hd8bbffd_0
  - freexl=1.0.6=h9ed2024_0
  - funcsigs=1.0.2=py27hb9f6266_0
  - functools32=3.2.3.2=py27_1
  - futures=3.3.0=py27_0
  - gdal=2.3.3=py27hbe65578_0
  - geos=3.7.1=h0a44026_0
  - gettext=0.21.0=h7535e17_0
  - giflib=5.1.4=h1de35cc_1
  - glib=2.56.2=hd9629dc_0
  - hdf4=4.2.13=h39711bb_2
  - hdf5=1.10.4=hfa1e0ec_0
  - html5lib=0.9999999=py27_0
  - icu=58.2=h0a44026_3
  - intel-openmp=2022.0.0=hecd8cb5_3615
  - jpeg=9e=hca72f7f_0
  - json-c=0.13.1=h3efe00b_0
  - kealib=1.4.7=hf5ed860_6
  - kiwisolver=1.1.0=py27h0a44026_0
  - krb5=1.16.4=hddcf347_0
  - libblas=3.9.0=1_h43114d0_netlib
  - libboost=1.67.0=hebc422b_4
  - libcblas=3.9.0=3_h7d47d6b_netlib
  - libcurl=7.67.0=h051b688_0
  - libcxx=12.0.0=h2f01273_0
  - libdap4=3.19.1=h3d3e54a_0
  - libedit=3.1.20210910=hca72f7f_0
  - libffi=3.3=hb1e8313_2
  - libgdal=2.3.3=h0950a36_0
  - libgfortran=4.0.0=7_5_0_h1a10cd1_23
  - libgfortran4=7.5.0=h1a10cd1_23
  - libiconv=1.16=hca72f7f_2
  - libkml=1.3.0=hbe12b63_4
  - liblapack=3.9.0=3_h7d47d6b_netlib
  - libnetcdf=4.6.1=hd5207e6_2
  - libpng=1.6.37=ha441bb4_0
  - libpq=11.5=h31a01ba_2
  - libprotobuf=3.11.2=hd9629dc_0
  - libspatialite=4.3.0a=h644ec7d_19
  - libssh2=1.10.0=h0a4fc7d_0
  - libtiff=4.1.0=hcb84e12_0
  - libxml2=2.9.14=hbf8cd5e_0
  - llvm-openmp=12.0.0=h0dcd299_1
  - lz4-c=1.8.1.2=h1de35cc_0
  - markdown=3.1.1=py27_0
  - matplotlib=2.2.3=py27h54f8f79_0
  - mkl=2019.4=233
  - mkl-service=2.3.0=py27hfbe908c_0
  - mkl_fft=1.0.15=py27h5e564d8_0
  - mkl_random=1.1.0=py27ha771720_0
  - mock=3.0.5=py27_0
  - ncurses=6.3=hca72f7f_2
  - numpy=1.15.4=py27hbb3c62a_1002
  - opencv=2.4.11=py27_1
  - openjpeg=2.4.0=h66ea3da_0
  - openssl=1.1.1o=hca72f7f_0
  - pandas=0.24.2=py27h86efe34_0
  - pcre=8.45=h23ab428_0
  - pip=19.3.1=py27_0
  - pixman=0.40.0=h9ed2024_1
  - poppler=0.65.0=ha097c24_1
  - poppler-data=0.4.11=hecd8cb5_0
  - postgresql=11.5=h26bc10f_2
  - proj4=5.2.0=h0a44026_1
  - protobuf=3.11.2=py27h0a44026_0
  - pycodestyle=2.7.0=pyhd3eb1b0_0
  - pyparsing=2.4.7=pyhd3eb1b0_0
  - python=2.7.18=h47d645e_1
  - python-dateutil=2.8.2=pyhd3eb1b0_0
  - pytz=2021.3=pyhd3eb1b0_0
  - readline=8.1.2=hca72f7f_1
  - scikit-learn=0.20.3=py27h27c97d8_0
  - scipy=1.2.1=py27h7e0e109_2
  - setuptools=44.0.0=py27_0
  - singledispatch=3.7.0=pyhd3eb1b0_1001
  - six=1.16.0=pyhd3eb1b0_1
  - sqlite=3.38.5=h707629a_0
  - subprocess32=3.5.4=py27h1de35cc_0
  - tbb=4.3_20141023=0
  - tensorboard=0.4.0rc3=py27_2
  - tensorflow=1.4.0=py27_0
  - tk=8.6.12=h5d9f67b_0
  - toml=0.10.2=pyhd3eb1b0_0
  - tornado=5.1.1=py27h1de35cc_0
  - tzcode=2022e=hb7f2c08_0
  - webencodings=0.5.1=py27_1
  - werkzeug=1.0.1=pyhd3eb1b0_0
  - wheel=0.37.1=pyhd3eb1b0_0
  - xarray=0.11.3=py27_0
  - xerces-c=3.2.3=h48eee30_0
  - xz=5.2.5=hca72f7f_1
  - zlib=1.2.12=h4dc903c_2
  - zstd=1.3.7=h5bba6e5_0

@jsmoraga-fathom
Copy link

I have the exact same problem described by @akashcmd. My environment looks like this:

Name Version Build Channel

_libgcc_mutex 0.1 main
asn1crypto 1.2.0 py27_0
backports 1.0 py_2
backports.functools_lru_cache 1.5 py_2
backports_abc 0.5 py27_0
blas 1.0 mkl
bleach 1.5.0 py27_0 conda-forge
bzip2 1.0.8 h7b6447c_0
ca-certificates 2023.5.7 hbcca054_0 conda-forge
cairo 1.14.12 h8948797_3
certifi 2019.11.28 py27h8c360ce_1 conda-forge
cffi 1.13.1 py27h2e261b9_0
chardet 3.0.4 py27_1003
conda 4.7.12 py27_0
conda-package-handling 1.6.0 py27h7b6447c_0
cryptography 2.8 py27h1ba5d50_0
curl 7.65.3 hbc83047_0
cycler 0.10.0 py27_0
dbus 1.13.12 h746ee38_0
enum34 1.1.6 py27_1
expat 2.2.6 he6710b0_0
fontconfig 2.13.0 h9420a91_0
freetype 2.9.1 h8a8886c_1
freexl 1.0.5 h14c3975_0
funcsigs 1.0.2 py27_0
functools32 3.2.3.2 py27_1
futures 3.3.0 py27_0
gdal 2.3.3 py27hbb2a789_0
geos 3.7.1 he6710b0_0
giflib 5.1.4 h14c3975_1
glib 2.63.1 h5a9c865_0
graphite2 1.3.13 h58526e2_1001 conda-forge
gst-plugins-base 1.14.0 hbbd80ab_1
gstreamer 1.14.0 hb453b48_1
harfbuzz 1.8.8 hffaf4a1_0
hdf4 4.2.13 h3ca952b_2
hdf5 1.10.4 hb1b8bf9_0
html5lib 0.9999999 py27_0 conda-forge
icu 58.2 h9c2bf20_1
idna 2.8 py27_0
intel-openmp 2019.4 243
ipaddress 1.0.23 py_0
jpeg 9b h024ee3a_2
json-c 0.13.1 h1bed415_0
kealib 1.4.7 hd0c454d_6
kiwisolver 1.1.0 py27he6710b0_0
krb5 1.16.1 h173b8e3_7
libboost 1.67.0 h46d08c1_4
libcurl 7.65.3 h20c2e04_0
libdap4 3.19.1 h6ec2957_0
libedit 3.1.20181209 hc058e9b_0
libffi 3.2.1 hd88cf55_4
libgcc-ng 9.1.0 hdf63c60_0
libgdal 2.3.3 h2e7e64b_0
libgfortran-ng 7.3.0 hdf63c60_0
libkml 1.3.0 h590aaf7_4
libnetcdf 4.6.1 h11d0813_2
libpng 1.6.37 hbc83047_0
libpq 11.2 h20c2e04_0
libprotobuf 3.9.2 hd408876_0
libspatialite 4.3.0a hb08deb6_19
libssh2 1.8.2 h1ba5d50_0
libstdcxx-ng 9.1.0 hdf63c60_0
libtiff 4.1.0 h2733197_0
libuuid 1.0.3 h1bed415_2
libxcb 1.13 h1bed415_1
libxml2 2.9.9 hea5a465_1
markdown 3.1.1 py27_0
matplotlib 2.2.3 py27hb69df0a_0
mkl 2019.4 243
mkl-service 2.3.0 py27he904b0f_0
mkl_fft 1.0.15 py27ha843d7b_0
mkl_random 1.1.0 py27hd6b4f25_0
mock 3.0.5 py27_0
ncurses 6.1 he6710b0_1
numpy 1.16.5 py27h7e9f1db_0
numpy-base 1.16.5 py27hde5b4d6_0
olefile 0.46 py27_0
opencv 2.4.11 nppy27_0 menpo
openjpeg 2.3.0 h05c96fa_1
openssl 1.1.1h h516909a_0 conda-forge
pandas 0.24.2 py27he6710b0_0
pango 1.40.14 he752989_2 conda-forge
pcre 8.43 he6710b0_0
pillow 6.2.1 py27h34e0f95_0
pip 19.3.1 py27_0
pixman 0.38.0 h7b6447c_0
poppler 0.65.0 h581218d_1
poppler-data 0.4.9 0
proj4 5.2.0 he6710b0_1
protobuf 3.9.2 py27he6710b0_0
pycosat 0.6.3 py27h14c3975_0
pycparser 2.19 py27_0
pyopenssl 19.0.0 py27_0
pyparsing 2.4.2 py_0
pyqt 5.9.2 py27h05f1152_2
pysocks 1.7.1 py27_0
python 2.7.17 h9bab390_0
python-dateutil 2.8.1 py_0
python_abi 2.7 1_cp27mu conda-forge
pytz 2019.3 py_0
qt 5.9.7 h5867ecd_1
readline 7.0 h7b6447c_5
requests 2.22.0 py27_0
ruamel_yaml 0.15.46 py27h14c3975_0
scikit-learn 0.20.3 py27hd81dba3_0
scipy 1.2.1 py27h7c811a0_0
setuptools 41.6.0 py27_0
singledispatch 3.4.0.3 py27_0
sip 4.19.8 py27hf484d3e_0
six 1.12.0 py27_0
sqlite 3.30.1 h7b6447c_0
subprocess32 3.5.4 py27h7b6447c_0
tensorflow 1.4.1 0
tensorflow-base 1.4.1 py27hd00c003_2
tensorflow-tensorboard 1.5.1 py27hf484d3e_1
tk 8.6.8 hbc83047_0
tornado 5.1.1 py27h7b6447c_0
tqdm 4.36.1 py_0
urllib3 1.24.2 py27_0
webencodings 0.5.1 py27_1
werkzeug 0.16.0 py_0
wheel 0.33.6 py27_0
xarray 0.11.3 py27_0
xerces-c 3.2.2 h780794e_0
xz 5.2.4 h14c3975_4
yaml 0.1.7 had09818_2
zlib 1.2.11 h7b6447c_3
zstd 1.3.7 h0b5b093_0

Have you got any idea, @tjvandal? Thanks!

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