logix-project / logix

AI Logging for Interpretability and Explainability🔬
Apache License 2.0
74 stars 6 forks source link

Non-writable tensor warning #64

Closed sangkeun00 closed 8 months ago

sangkeun00 commented 8 months ago
analog/storage/log_loader.py:52: UserWarning: The given NumPy array is not writable, and PyTorch does not support non-writable tensors. This means writing to this tensor will result in undefined behavior. You may want to copy the array to protect its data or make it writable before converting it to a tensor. This type of warning will be suppressed for the rest of this program. (Triggered internally at ../torch/csrc/utils/tensor_numpy.cpp:206.)
  tensor = torch.Tensor(array)

I believe we set writable=False somewhere in the log saving code, which leads to the above warning message. While this doesn't really have any effects on the downstream computation, it would be nice if we can remove this warning, potentially by modifying DefaultLogDataset.

@eatpk

eatpk commented 8 months ago

Please check https://github.com/sangkeun00/analog/pull/69