Skip to content

AttributeError: 'int' object has no attribute 'shape' #8

@EsToHi

Description

@EsToHi

Hi dear,

I used alphafold's pdb as input but I ended up with following error.
That's the line 68 in Data.py happened in seq_emb = np.tile(seq_emb,(atom_emb.shape[0],1))
Then I added print command to know exactly why the error happened : print("Shape of seq_emb:", seq_emb.shape)
print("Shape of atom_emb:", atom_emb.shape)

  • This suggests that atom_emb is not being assigned the expected array-like object, but rather an integer value.

The error message :
2024-03-21 06:41:59.870582: I tensorflow/core/platform/cpu_feature_guard.cc:210] This TensorFlow binary is optimized to use available CPU instructions in performance-critical operations.
To enable the following instructions: AVX2 FMA, in other operations, rebuild TensorFlow with the appropriate compiler flags.
WARNING:root:Warning: importing 'simtk.openmm' is deprecated. Import 'openmm' instead.
Global seed set to 4022849662
2024-03-21 06:42:01.931396: E external/org_tensorflow/tensorflow/compiler/xla/stream_executor/cuda/cuda_driver.cc:267] failed call to cuInit: CUDA_ERROR_NO_DEVICE: no CUDA-capable device is detected
WARNING:jax._src.lib.xla_bridge:No GPU/TPU found, falling back to CPU. (Set TF_CPP_MIN_LOG_LEVEL=0 and rerun for more info.)
/data/sharedData/ATOMRefine/amber/stereo_chemical_props.txt
/data/sharedData/Post-modeling/Refined2/Vdp236.pdb
[['/data/sharedData/Post-modeling/Refined2/Vdp236.pdb', '/data/sharedData/Post-modeling/Refined2/Vdp236.pdb']]
Start prediction ...Predict each model may take 4 or 5 mins...In total, 5 models will be generated....
Shape of seq_emb: (21,)
Shape of atom_emb: (6, 40)
Shape of seq_emb: (21,)
Shape of atom_emb: (4, 40)
Shape of seq_emb: (21,)
Shape of atom_emb: (6, 40)
Shape of seq_emb: (21,)
Shape of atom_emb: (9, 40)
Shape of seq_emb: (21,)
Shape of atom_emb: (6, 40)
Shape of seq_emb: (21,)
Shape of atom_emb: (4, 40)
Shape of seq_emb: (21,)
Shape of atom_emb: (10, 40)
Shape of seq_emb: (21,)

Traceback (most recent call last):
File "/data/sharedData/ATOMRefine/predict.py", line 196, in
for batch in test_loader:
File "/data/sharedData/colabfold/localcolabfold/colabfold-conda/lib/python3.10/site-packages/torch/utils/data/dataloader.py", line 631, in next
data = self._next_data()
File "/data/sharedData/colabfold/localcolabfold/colabfold-conda/lib/python3.10/site-packages/torch/utils/data/dataloader.py", line 1346, in _next_data
return self._process_data(data)
File "/data/sharedData/colabfold/localcolabfold/colabfold-conda/lib/python3.10/site-packages/torch/utils/data/dataloader.py", line 1372, in _process_data
data.reraise()
File "/data/sharedData/colabfold/localcolabfold/colabfold-conda/lib/python3.10/site-packages/torch/_utils.py", line 722, in reraise
raise exception
AttributeError: Caught AttributeError in DataLoader worker process 0.
Original Traceback (most recent call last):
File "/data/sharedData/colabfold/localcolabfold/colabfold-conda/lib/python3.10/site-packages/torch/utils/data/_utils/worker.py", line 308, in _worker_loop
data = fetcher.fetch(index)
File "/data/sharedData/colabfold/localcolabfold/colabfold-conda/lib/python3.10/site-packages/torch/utils/data/_utils/fetch.py", line 51, in fetch
data = [self.dataset[idx] for idx in possibly_batched_index]
File "/data/sharedData/colabfold/localcolabfold/colabfold-conda/lib/python3.10/site-packages/torch/utils/data/_utils/fetch.py", line 51, in
data = [self.dataset[idx] for idx in possibly_batched_index]
File "/data/sharedData/ATOMRefine/Data.py", line 69, in getitem
print("Shape of atom_emb:", atom_emb.shape)
AttributeError: 'int' object has no attribute 'shape'

Metadata

Metadata

Assignees

No one assigned

    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