dros1986 / scalable-cnn-for-soil-properties-estimation

7 stars 0 forks source link

The input and output sizes do not match #1

Open Tom1123456 opened 5 months ago

Tom1123456 commented 5 months ago

1719550085808

/home/anaconda3/envs/soil/bin/python -X pycache_prefix=/home/.cache/JetBrains/PyCharmCE2023.3/cpython-cache /home/pycharm-community-2023.3.4/plugins/python-ce/helpers/pydev/pydevd.py --multiprocess --qt-support=auto --client 127.0.0.1 --port 44831 --file /home/PycharmProjects/pythonProject/scalable-cnn-for-soil-properties-estimation/train_from_json.py --json /home/PycharmProjects/pythonProject/scalable-cnn-for-soil-properties-estimation/peizhi.json --outdir /home/PycharmProjects/pythonProject/scalable-cnn-for-soil-properties-estimation/outdir/ Connected to pydev debugger (build 233.14475.56) Backend TkAgg is interactive backend. Turning interactive mode on. Weights will be saved in /home/PycharmProjects/pythonProject/scalable-cnn-for-soil-properties-estimation/outdir/ The number of filters are: [1,16,32,64,128,128,128,128] GPU available: True, used: True TPU available: None, using: 0 TPU cores LOCAL_RANK: 0 - CUDA_VISIBLE_DEVICES: [0,1,2,3]

| Name | Type | Params

0 | net | Net | 493 K 1 | src_norm | InstanceStandardization | 0
2 | tgt_norm | VariableStandardization | 0
3 | tgt_quant | Quantizer | 0

493 K Trainable params 0 Non-trainable params 493 K Total params Validation sanity check: 0it [00:00, ?it/s]python-BaseException Traceback (most recent call last): File "/home/anaconda3/envs/soil/lib/python3.8/contextlib.py", line 131, in exit self.gen.throw(type, value, traceback) File "/home/anaconda3/envs/soil/lib/python3.8/site-packages/pytorch_lightning/profiler/profilers.py", line 74, in profile yield action_name File "/home/anaconda3/envs/soil/lib/python3.8/site-packages/pytorch_lightning/trainer/trainer.py", line 606, in run_evaluation output = self.evaluation_loop.evaluation_step(test_mode, batch, batch_idx, dataloader_idx) File "/home/anaconda3/envs/soil/lib/python3.8/site-packages/pytorch_lightning/trainer/evaluation_loop.py", line 178, in evaluation_step output = self.trainer.accelerator_backend.validation_step(args) File "/home/anaconda3/envs/soil/lib/python3.8/site-packages/pytorch_lightning/accelerators/gpu_accelerator.py", line 84, in validation_step return self._step(self.trainer.model.validation_step, args) File "/home/anaconda3/envs/soil/lib/python3.8/site-packages/pytorch_lightning/accelerators/gpu_accelerator.py", line 76, in _step output = model_step(args) File "/home/PycharmProjects/pythonProject/scalable-cnn-for-soil-properties-estimation/Experiment.py", line 91, in validation_step out = self(src) File "/home/anaconda3/envs/soil/lib/python3.8/site-packages/torch/nn/modules/module.py", line 889, in _call_impl result = self.forward(input, *kwargs) File "/home/PycharmProjects/pythonProject/scalable-cnn-for-soil-properties-estimation/Experiment.py", line 70, in forward return self.net(x) File "/home/anaconda3/envs/soil/lib/python3.8/site-packages/torch/nn/modules/module.py", line 889, in _call_impl result = self.forward(input, **kwargs) File "/home/PycharmProjects/pythonProject/scalable-cnn-for-soil-properties-estimation/networks.py", line 61, in forward x = F.interpolate(x, size=self.insz, mode='linear', align_corners=True) File "/home/anaconda3/envs/soil/lib/python3.8/site-packages/torch/nn/functional.py", line 3548, in interpolate return torch._C._nn.upsample_linear1d(input, output_size, align_corners, scale_factors) RuntimeError: input and output sizes should be greater than 0, but got input (W: 0) and output (W: 512)

I guess I may have entered the data set incorrectly. The data set I entered has 4285 columns. Can you help me

dros1986 commented 5 months ago

Dear @Tom1123456, I have 4215 columns. The first 4200 are the hyperspectral signal (cols "spc.400", "spc.400.5", ..., "spc.2499.5"), while the remaining 15 are "GPS_LAT", "GPS_LONG", "coarse", "clay", "silt", "sand", "pH.in.CaCl2", "pH.in.H2O", "OC", "CaCO3", "N", "P", "K", "CEC", "set". Attached you will find the first three rows of the training file that I used.

Please let me know if you can solve the problem or if you need further assistance / questions.

Thank you

arifalfin commented 4 weeks ago

I've same issues like @Tom1123456, would you mind to share your traning data? so, that I can know the overall context.

Thank you